From: Operating system: Irrelevant PHP version: Irrelevant Package: *XML functions Bug Type: Feature/Change Request Bug description:Provide readonly access to the meta data for the XML stream.
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. -- Edit bug report at https://bugs.php.net/bug.php?id=55821&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55821&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55821&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55821&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55821&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55821&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55821&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55821&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55821&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55821&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55821&r=support Expected behavior: https://bugs.php.net/fix.php?id=55821&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55821&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55821&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55821&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55821&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55821&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55821&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55821&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55821&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55821&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55821&r=mysqlcfg