*
* Initializes the wrapped XMLWriter.
*
- * @param $output URL for outputting, defaults to stdout
- * @param $indent Whether to indent output, default true
+ * @param string $output URL for outputting, defaults to stdout
+ * @param boolean $indent Whether to indent output, default true
*/
function __construct($output='php://output', $indent=true)
$this->xw = new XMLWriter();
$this->xw->openURI($output);
$this->xw->setIndent($indent);
- $this->xw->startDocument('1.0', 'UTF-8');
}
/**
function startXML($doc=null, $public=null, $system=null)
{
+ $this->xw->startDocument('1.0', 'UTF-8');
if ($doc) {
$this->xw->writeDTD($doc, $public, $system);
}
* raw output, use elementStart() and elementEnd() with a call
* to raw() in the middle.
*
+ * If $attrs is a string instead of an array, it will be treated
+ * as the class attribute of the element.
+ *
* @param string $tag Element type or tagname
* @param array $attrs Array of element attributes, as
* key-value pairs
* Mostly used for when an element has content that's
* not a simple string.
*
+ * If $attrs is a string instead of an array, it will be treated
+ * as the class attribute of the element.
+ *
* @param string $tag Element type or tagname
* @param array $attrs Array of element attributes
*
{
$this->xw->writeRaw($xml);
}
+
+ /**
+ * output a comment
+ *
+ * @param string $txt text of the comment
+ *
+ * @return void
+ */
+
+ function comment($txt)
+ {
+ $this->xw->writeComment($txt);
+ }
}