Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#33 parsing a portion of a single xml document at a time

open
nobody
3
2003-07-13
2003-06-08
Anonymous
No

I'd like to see a :

void parse( String chunkOfXmlDoc, boolean isFinished );

along the same lines as Expat or libxml's primary parse
routines. I'd like the parser to parse what it can of
this chunk and perform whatever callbacks it is able
to, then return. Then I want to be able to call the
same parser some time in the future with another string
which will be appended to whatever is remaining of the
parser's buffer and parsing will continue where it left
off.

I hope this doesn't sound unreasonable. I'm able to
simulate this behavior with multiple threads or by
hacking my xml parser of choice, but it would be nice
if there was a standard extension simiiar to this.

Discussion

  • David Brownell
    David Brownell
    2003-07-13

    Logged In: YES
    user_id=44117

    The classic answer for how to do this sort of thing in SAX
    is exactly as you noted: multiple threads. One would push
    the buffer to the input stream, the other would read that stream
    and issue the callbacks. This can easily be done today, with
    no change to the API, and in fact has been done many times.

    Since that's such a straighforward approach, I'm marking
    this as a lower priority.

     
  • David Brownell
    David Brownell
    2003-07-13

    • priority: 5 --> 3