[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:

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


</messages>


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