[jdom-interest] reading xml from a socket

Richard Cook rpc at prismtechnologies.com
Tue May 15 11:05:58 PDT 2001

If you don't want to close the stream, I don't know if this would work, but
if you used SAX and changed the input stream to look like:

  <message id="1">
    <body>Hello World</body>
  <message id="2">
    <body>Hello again</body>


where the server sent "<messages>" on open and "</messages>" on close, how
would SAX react - would you be able to use startElement() endElement() etc
to detect messages as they arrive

Depending on what you want you could either not use JDOM or build up a
message String and parse that into a JDOM document.

More information about the jdom-interest mailing list