php-src/ext/simplexml/tests/008.phpt

40 lines
644 B
Plaintext
Raw Normal View History

2003-11-04 06:49:24 +08:00
--TEST--
SimpleXML and XPath
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml =<<<EOF
<?xml version='1.0'?>
<!DOCTYPE sxe SYSTEM "notfound.dtd">
<sxe id="elem1">
<elem1 attr1='first'>
<!-- comment -->
<elem2>
<elem3>
<elem4>
<?test processing instruction ?>
</elem4>
</elem3>
</elem2>
</elem1>
</sxe>
EOF;
$sxe = simplexml_load_string($xml);
var_dump($sxe->xpath("elem1/elem2/elem3/elem4"));
var_dump($sxe->xpath("***"));
2003-11-04 06:49:24 +08:00
?>
--EXPECTF--
array(1) {
[0]=>
object(simplexml_element)#%d (1) {
["test"]=>
object(simplexml_element)#%d (0) {
}
}
}
bool(false)