1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Files
archived-php-src/ext/dom/tests/domxpath.phpt
T
Rob Richards 45364aea04 mark more functions unicode safe
add test
2006-12-08 16:49:25 +00:00

32 lines
592 B
PHP

--TEST--
DOMXPath Tests
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
require_once("dom_test.inc");
$dom = new DOMDocument;
$dom->loadXML(b'<root xmlns="urn::default"><child>myval</child></root>');
$xpath = new DOMXPath($dom);
$xpath->registerNamespace("def", "urn::default");
$nodelist = $xpath->query("//def:child");
if ($node = $nodelist->item(0)) {
print $node->textContent."\n";
}
$count = $xpath->evaluate("count(//def:child)");
var_dump($count);
$xpathdoc = $xpath->document;
var_dump($xpathdoc instanceof DOMDocument);
?>
--EXPECT--
myval
float(1)
bool(true)