Humm, I should have asked if your really need to pretty print the XML
before sending off the suggestions in a hurry.
I am not so sure if thats what you want.
I have not tried this particular usecase you are describing, and not
sure about what work around.
-Prashant
Umesh wrote:
Hi
After lot of search on net, still I am unable to find out a solution
to propertly indent XML document.
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
"0");
The above lines of code seems to work only in a particular situation
where the original XML doc doesn't have any newline or space
characters, i.e. it is one single line.
If the unindented XML doc has any spaces or newline, the program fails
to indent the file completely which one would expect (It indents but
partially, and retains the space, newline in unindented file).
I am using JDK 5.
Is this such a difficult problem to solve? Any help, clues?
Regds
Umesh
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]