0

I have some XML data:

<entries><entry><templateID>F04FD51B-C537-4d02-BB1D-E89971D1D65</templateID><entryID>41</entryID><subject>Updated Terms and Conditions</subject>

I want to format the XMl data into proper format using Java code

Can any one suggest, how to format XML data using Java.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • What do you mean "format"? It might help if you showed us a snippet of the file now, and a snippet of how you want it to look. – Richard H Apr 28 '11 at 07:53
  • That doesn't look like XML data to me. I suggest you work out how to make it look like valid XML data in an editor first before you try to program it. – Peter Lawrey Apr 28 '11 at 07:53
  • @Peter - I'm not seeing a link or data? – Richard H Apr 28 '11 at 07:54
  • Ahh - I though F04FD... was the file name! OK yes, this is not xml. – Richard H Apr 28 '11 at 07:55
  • @Richard, I am ssuming the `data(...)` contains the information he wants to format as XML. But until he knows what it would look like he won't be able to program it. – Peter Lawrey Apr 28 '11 at 07:55
  • 1
    possible duplicate of [how to pretty print xml from Java](http://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java) – Joachim Sauer Apr 28 '11 at 07:58

1 Answers1

1

See how-to-pretty-print-xml-from-java

Community
  • 1
  • 1
morja
  • 8,297
  • 2
  • 39
  • 59