You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Son To <so...@gateway.homeip.net> on 2000/12/03 05:30:44 UTC

streaming XML

Hello,

I am using the xerces SAX parser to read XML from a socket, but it seems
the SAXParser.parse(InputSource) only starts parsing when the client
closes the stream. How do I stream XML documents to the parser?

here is code snipplets:

...
java.io.BufferedReader input =  new BufferedReader( new InputStreamReader(socket.getInputStream()) );
...
saxParser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
...
saxParser.parse(new InputSource(input));

At first, I thought the problem was a result of BufferedReader 
buffering the data beforesending it to the parser, but this is not the
case because InputStreamReader (unbuffered) doesn't work either.

any help is appreciated,
Son