[jdom-interest] InputSource?

Steve Beech JBeech at dmu.ac.uk
Mon Feb 18 06:03:35 PST 2002

Dear All,

I have a problem. I have a server/client set up and want to send a XML doc
from client to server.
Server then reads XML doc using JDOM.

On the client I create a printwriter on the socket like so....
out = new PrintWriter(testSocket.getOutputStream(), true);
and write my xml doc using....

On server I open an input source thus:
InputSource is = new InputSource(socket.getInputStream());

and then call my JDOM method:

jdh.saxDoc(is, out);

Method is as follows:

public void saxDoc (InputSource is, PrintWriter out) throws IOException,
JDOMException {        
        SAXBuilder builder = new SAXBuilder(false);
        Document doc = builder.build(is);

However, this just hangs and never appears to finish building. I think I
must be using InputSource incorrectly or something.
Can anybody help?

Thanks in advance,

Steve Beech                                                       Tel: 0116
207 8162
Software Developer                                   e-mail:
jbeech at dmu.ac.uk
Room 0.36 Portland Building        e-mail: steve at monkey-media.co.uk
De Montfort University
The Gateway, Leicester LE1 9BH

More information about the jdom-interest mailing list