If I have some XML, for example:
<library>
<books>
<book>
<title>book #1</title>
</book>
<book>
<title>book #2</title>
</book>
</books>
<authors>
<author>
<name>author #1</name>
</author>
<author>
<name>author #2</name>
</author>
</authors>
</library>
And having manoeuvred my cursor to the first book element I loop using:
do {
//...
} while($xml->next("book"));
When my cursor is on the last book element and the next("book") is called, what happens to the cursor?
</library> and return false.I cannot figure out how to get the current cursor position to figure this out for myself.
Having looked at the source code of that function: http://lxr.php.net/xref/PHP_5_4/ext/xmlreader/php_xmlreader.c#821
It would appear that pointer moves to the end of the XML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With