2004-01-18 15:33:38 +00:00
|
|
|
--TEST--
|
|
|
|
SPL: SimpleXMLIterator
|
|
|
|
--SKIPIF--
|
2005-07-20 07:33:19 +00:00
|
|
|
<?php
|
|
|
|
if (!extension_loaded("simplexml")) print "skip SimpleXML not present";
|
|
|
|
if (!extension_loaded("libxml")) print "skip LibXML not present";
|
|
|
|
?>
|
2004-01-18 15:33:38 +00:00
|
|
|
--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;
|
|
|
|
|
2006-09-19 12:01:18 +00:00
|
|
|
var_dump(simplexml_load_string((binary)$xml, 'SimpleXMLIterator'));
|
2004-01-18 15:33:38 +00:00
|
|
|
|
|
|
|
?>
|
|
|
|
===DONE===
|
2005-10-29 21:01:03 +00:00
|
|
|
--EXPECTF--
|
2005-10-30 14:00:45 +00:00
|
|
|
object(SimpleXMLIterator)#%d (2) {
|
|
|
|
[u"@attributes"]=>
|
|
|
|
array(1) {
|
|
|
|
[u"id"]=>
|
2005-12-07 16:52:13 +00:00
|
|
|
unicode(5) "elem1"
|
2005-10-30 14:00:45 +00:00
|
|
|
}
|
|
|
|
[u"elem1"]=>
|
|
|
|
object(SimpleXMLIterator)#%d (3) {
|
|
|
|
[u"@attributes"]=>
|
|
|
|
array(1) {
|
|
|
|
[u"attr1"]=>
|
2005-12-07 16:52:13 +00:00
|
|
|
unicode(5) "first"
|
2005-10-30 14:00:45 +00:00
|
|
|
}
|
|
|
|
[u"comment"]=>
|
|
|
|
object(SimpleXMLIterator)#%d (0) {
|
|
|
|
}
|
|
|
|
[u"elem2"]=>
|
|
|
|
object(SimpleXMLIterator)#%d (1) {
|
|
|
|
[u"elem3"]=>
|
|
|
|
object(SimpleXMLIterator)#%d (1) {
|
|
|
|
[u"elem4"]=>
|
|
|
|
object(SimpleXMLIterator)#%d (1) {
|
|
|
|
[u"test"]=>
|
|
|
|
object(SimpleXMLIterator)#%d (0) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
===DONE===
|