You are here

public function QueryPath::innerXML in QueryPath 7.3

Same name and namespace in other branches
  1. 6 QueryPath/QueryPath.php \QueryPath::innerXML()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::innerXML()
1 call to QueryPath::innerXML()
QueryPath::innerHTML in QueryPath/QueryPath.php

File

QueryPath/QueryPath.php, line 1209

Class

QueryPath

Code

public function innerXML() {
  $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);
  }
  return $buffer;
}