• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Writing xml data to file from TCP port

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Currently my program code is listening to TCP port and I will be receiviing XML data and the data will be save to a file.

The issue is that the XML data contains the respond data from the server whenever it send back to the client, how can I get rid of the respond data.

Example,

respond=ok;blah blah
<xml>
......
......
</xml>

if there are two responds... it will be

respond=ok;blah blah
<xml>
......
......
</xml>
respond=ok;blah blah
<xml>
......
......
</xml>


So I do not want to write the "respond=ok;blah blah" to the xml file. Because once I write that to a file, it will not be in a XML format. Please advice on how can I read the XML data from the TCP port correctly and save it to a file. Thanks.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read parts of the data in advance (perhaps one line at a time), and only start writing once you've encountered the XML start.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic