Christopher Ebert wrote:
I'm not doing this sort of thing, but have you tried using a second parser object? i.e. create an input source (or whatever you use), hand it to one parser then hand it to a second parser after the first one's done. Just a thought...

This won't work in general because the documents may be in different encodings and the parser buffers ahead of where it's scanning, for performance.

There is a sample included in Xerces (check the samples/
socket/io/ directory for the necessary classes). However,
as Jakub mentioned, you have to be in control of both
ends of the stream. But unless you have this control
(either directly or indirectly through some established
protocol), you can't solve this problem generally. It's
just the way that XML is defined.

I go into some depth on this topic in Chapter 6 of the
new book by Addison-Wesley, _XML and Java: Developing
Web Applications (2nd edition)_[1]. The solution offered
is to use the sample classes in Xerces2 but I discuss
the cause of this problem and why it's hard to solve.

[1] http://www.aw.com/catalog/academic/product/1,4096,0201770040,00.html

--
Andy Clark * [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to