Forgive me if this has been brought up before, but I can't find anything
about it.  

First off:  Win NT 4.0, Sun JDK 1.1.8, Xerces-J 1.0.  

I'm writing something where a client sends XML messages to a server and
the server responds to the messages individually.  I've tried a couple
different ways and can't get it to work.  The server is using SAX to
parse the input.  

My first try was to have the client send a couple of full documents.
However, the server griped about this:  
"[Fatal Error] :1 :37: The markup in the document following the root
element must be well-formed."   Okay, it figures the top-level element
is the root and doesn't want to see other elements after that.  I guess
it doesn't see anything it can interpret as an end-of-document.  Fair
enough.  

For testing, I then tried just manually writing some strings to the
stream.  I gave it a <ROOT> element, inside of which I gave it a <MSG>
element.  I had the client pause a few seconds and then write a second
<MSG> element, and then closed the <ROOT>.  All the elements were
correctly received -- but not until everything had been written.  (I
flushed the stream after writing the first <MSG>.)  

Shouldn't the server get & interpret elements as soon as they are
available from the stream?  Does SAX wait to have an entire element
before it calls events?  I can't close the stream between messages; it
seems I can't have them in seperate documents; so how do I get the
server to react to the incoming data?  Is this a problem with Xerces or
with what I'm trying to do with it?  

Thanks!

David Cassel
Software Engineer
CyberFone, Inc.
610-989-9330x33


Reply via email to