|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ My start point is the SimpleXMLIterator, but I realise the the any extension based upon libxml would have the same issue. When you are reading a XML stream, file or string, there is no mechanism available to access the position within the XML unless you implement a 2 pass mechanism to count the nodes in the first pass and then record your position in the second pass. Using the count() method is available in some of the XML classes, but this is still a 2 pass system. My feature would be to have a mechanism to be able to read the start and end position of the element as well as knowing the total size of the file. So the progress through the file is still possible (and displayed as a %age rather than as an "n of m"). From what I can see, this is not a minor amount of work. Especially as I can do something like ... $it = new SimpleXMLIterator('compress.zlib://http://www.site.com/file.xml.gz'); In this instance, there are 2 filelengths. The .gz file from the site as well as the streamed/expanded XML file. Realistically, only the expanded XML file value would be useful in my use case. It may be that any/all stream/filters/etc that interact with the data would need to be able to report their data.