public function QueryPath::innerXHTML in QueryPath 7.3
Same name and namespace in other branches
- 6 QueryPath/QueryPath.php \QueryPath::innerXHTML()
- 7.2 QueryPath/QueryPath.php \QueryPath::innerXHTML()
File
- QueryPath/
QueryPath.php, line 1184
Class
Code
public function innerXHTML() {
$length = $this
->size();
if ($length == 0) {
return NULL;
}
$first = $this
->getFirstMatch();
if (!$first instanceof DOMNode) {
return NULL;
}
elseif (!$first
->hasChildNodes()) {
return '';
}
$buffer = '';
foreach ($first->childNodes as $child) {
$buffer .= $this->document
->saveXML($child, LIBXML_NOEMPTYTAG);
}
return $buffer;
}