File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xml output formatting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml output formatting" Watch "xml output formatting" New topic

xml output formatting

Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
I am writing a DOM Document object to file using the TransformerFactory and Transformer classes.
It all works fine except for one thing. The output is one big block of text. I would like the xml to be indented properly.
I was looking at all the features and properties (and methods) of the factory and the transformer class but can't seem to find it.
It should be possible to write a formatted xml stream using a DOM object. Can anybody tell me how to do it?
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
Ah, I found it.
It was very simple but you just have to see it.
I agree. Here's the link:
subject: xml output formatting
It's not a secret anymore!