QueryPath\DOMQuery::writeXML PHP Метод

writeXML() публичный Метод

Write the document to a file path, if given, or to stdout (usually the client). This prints the entire document.
См. также: xml()
См. также: innerXML()
См. также: writeXHTML()
public writeXML ( string $path = null, integer $options = null )
$path string The path to the file into which the XML should be written. if this is NULL, data will be written to STDOUT, which is usually sent to the remote browser.
$options integer (As of QueryPath 2.1) Pass libxml options to the saving mechanism.
    public function writeXML($path = null, $options = null)
    {
        if ($path == null) {
            echo $this->document->saveXML(null, $options);
        } else {
            try {
                set_error_handler(array('\\QueryPath\\IOException', 'initializeFromError'));
                $this->document->save($path, $options);
            } catch (Exception $e) {
                restore_error_handler();
                throw $e;
            }
            restore_error_handler();
        }
        return $this;
    }