Re: [xml] XMLTextReader stream backward operation



On Thu, Sep 11, 2003 at 11:10:55PM -0700, Sriram Chadalavada wrote:
Hello libXML developers, 
    I am using the libXML XMLTextReader python binding
to parse >1 XML files. I need to be able to merge sort
these files into a single XML files based on the value
of an attribute of a main node. 
 
The problem I am facing is due to the fact
XMLTextReader 'read' operation is always an active
operation in that it moves the stream to next node. 

  yes that's the definition of that API.

      For those streams, whose values have not been
included in the merged file in the current pass, I
need to use the current nodes for the next passes. 
 
         Is there some way I can back track
(current->parent) using the XMLTextReader API so that
I can access the previous node? 

  Ancestor nodes are preserved but sibling are not available
and will be destroyed as parsing progresses. You can try to 
use the Expand to work on a full subtree, but in the current state
what you're asking for is not possible.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]