DocumentBuilder.parse don't get data from InputSource

D

David

Hi java folks,
I may have difficulties to explain clearly my problem, but I'm doing my
best.

I have a class "Receiver" which *receives* XML data on a socket. The
InputStream from the socket is packed as given below:

fluxLecture = new BufferedReader(new
InputStreamReader(socketClient.getInputStream()));

The other class "Sender", *sends* the XML data by calling println(String
str) on the PrintWriter object:

fluxEcriture.println(strXMLData);

Now I would like that "Receiver" interpretes the incoming XML data each
time a new XML data is sent by "Sender", so I do:

Document messageXML = interpreteurXML.parse(new InputSource(fluxLecture));

In fact i expected that each time:

fluxEcriture.println(strXMLData);

is called from the "Sender" a:

Document messageXML = interpreteurXML.parse(new InputSource(fluxLecture));

from the "Receiver" would get to parse the incoming XML data. But this is
not so.

Could someone explain me what am I doing wrong and how to solve
my problem please?

Thanking you for your attention.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top