Top.Mail.Ru
June 7th, 2004 - Java developers — LiveJournal
? ?

Java developers

June 7th, 2004
Image

02:05 pm - Imagestipe - SAX question

I've just tried switching from the Xerces SAX implementation to the one that comes bundled with Java 1.4 (Crimson) and have run into a bit of a problem. Using the code below, I get two very different behaviours - with Xerces, xml is parsed as it comes in (so the program below will print out "Start element: blah" as soon as it's recieved "<blah>"); with Crimson, the parser seems to wait until the stream has closed before throwing events for anything other than "Start Document".

I'm trying to parse the xml as it comes in off of a network stream which could stay open indefinitely, so waiting for it to close before parsing really isn't an option.

Does anyone know if there's a way to get the latter implementation to behave like the former?


Testing CodeCollapse )
Powered by LiveJournal.com
Image