public function QueryPath::textAfter in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::textAfter()
- 7.2 QueryPath/QueryPath.php \QueryPath::textAfter()
File
- QueryPath/
QueryPath.php, line 1280
Class
Code
public function textAfter($text = NULL) {
if (isset($text)) {
$textNode = $this->document
->createTextNode($text);
return $this
->after($textNode);
}
$buffer = '';
foreach ($this->matches as $m) {
$n = $m;
while (isset($n->nextSibling) && $n->nextSibling->nodeType == XML_TEXT_NODE) {
$n = $n->nextSibling;
$buffer .= $n->textContent;
}
}
return $buffer;
}