public function QueryPath::xhtml in QueryPath 7.2
Same name and namespace in other branches
- 6 QueryPath/QueryPath.php \QueryPath::xhtml()
- 7.3 QueryPath/QueryPath.php \QueryPath::xhtml()
File
- QueryPath/
QueryPath.php, line 1305
Class
Code
public function xhtml($markup = NULL) {
$omit_xml_decl = $this->options['omit_xml_declaration'];
if ($markup === TRUE) {
$omit_xml_decl = TRUE;
}
elseif (isset($markup)) {
return $this
->xml($markup);
}
$length = $this
->size();
if ($length == 0) {
return NULL;
}
$first = $this
->getFirstMatch();
if (!$first instanceof DOMNode) {
return NULL;
}
if ($first instanceof DOMDocument || $first
->isSameNode($first->ownerDocument->documentElement)) {
return $omit_xml_decl ? $this->document
->saveXML($first->ownerDocument->documentElement, LIBXML_NOEMPTYTAG) : $this->document
->saveXML(NULL, LIBXML_NOEMPTYTAG);
}
return $this->document
->saveXML($first, LIBXML_NOEMPTYTAG);
}