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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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-2019 The PHP Group
All rights reserved.
Last updated: Thu Aug 22 10:01:26 2019 UTC