php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55821 Provide readonly access to the meta data for the XML stream.
Submitted: 2011-09-30 16:39 UTC Modified: -
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: RQuadling at GMail dot com Assigned:
Status: Open Package: *XML functions
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: RQuadling at GMail dot com
New email:
PHP Version: OS:

 

 [2011-09-30 16:39 UTC] RQuadling at GMail dot com
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.




Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC