Re: [xml] how to advance the xmlParserInput.cur?



On Sat, Mar 11, 2006 at 11:00:01PM -0500, Wei Lu wrote:

Hi there
      I have a strang requirement for libxml2. During parsing a XML
document in the memory at some point I want to the parser to skip parsing
a chunk of memory, which is somehow guarnteed to just include a
well-balanced sub-tree. I modified the xmlParseContent function to skip a
chunk of memory when it detected a open tag. Any body can tell me the
correct and safe method to do that.

  By definition it's not correct, it's not an XML parser anymore, "somehow
it's XML" is not something I feel okay to provide help for. What do you intend
to do with this bastardized code ?

By guess I tried the
xmlParserInputGrow, which seems doesn't change the xmpParserInput.cur at
all; Now my work around is just increaing the xmlParserInput.cur directly,
seems works well, but when file size is large, I got segment fault.

Any clue is appreciated.

  You will need to refill the buffers if you get outside of the chunk
already availble in xmpParserInput. It is *not* trivial, encoding will
play a role too.

Daniel

-- 
Daniel Veillard      | Red Hat http://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]