options = $options; $this->doctype_system_id = $doctype_system_id; } function options() { return $this->options; } function doctype_system_id() { return $this->doctype_system_id; } abstract function serialize($str); } # Objects of this class serialize to the browser with the print function. class SendSerializer extends Serializer { function __construct($options, $doctype_system_id) { parent::__construct($options, $doctype_system_id); } function serialize($str) { return print($str); } } class SaveSerializer extends Serializer { private $doc; function __construct($doc, $options) { parent::__construct($options, $doc->replaced_doctype_system_id()); $this->doc = $doc; } function serialize($str) { return $this->doc->write($str); } } class StringSerializer extends Serializer { var $str = ''; function __construct($options, $doctype_system_id) { parent::__construct($options, $doctype_system_id); } function serialize($str) { $this->str .= $str; return TRUE; } } ?>