Easiest way to read a XML doc from file, reformat it and write it indented to a second file?

R

Raymond Schanks

Assume I have a XML docuemnt in file mydoc123.xml
The XML doc is textually formatted as one long line/string without line breaks.

Now I want to read this XML doc file into Java, then reformat it so
that the hierarchy levels are indented in a human radble format "as usual".

Finally the result should be written to another text file result.xml

How can I do this most easily (preferable without third party libraries but
only J2SE built-in functions)?

Ray
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top