[jdom-interest] Streaming XML
Jason Hunter
jhunter at collab.net
Mon Jun 19 15:02:05 PDT 2000
Dino Valente wrote:
>
> My application has to connect to a server that streams XML data. The
> problem I am having is that the SaxBuilder is not detecting the XML data
> chunk. I assumed that the builder would know the document root and would
> return automatically when it finds the end of it
I don't see how you'd reliably detect the end of a document. Even once
the root element closed, there might be comments and PIs remaining to be
read.
> and then I would perform
> another read to find the next XML chunk. What am I doing wrong? How does
> one deal with streaming XML data with Jdom?
Seems to me the stream you pass to the bulider has to end. If the
original stream contains multiple documents and doesn't end, then
somehow you need to determine how to separate documents and pass in a
filtered stream built on top that ends appropriately.
-jh-
More information about the jdom-interest
mailing list