A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
XML and Related Technologies
XSLT transformer formatting
Joined: Aug 12, 2006
Oct 13, 2006 11:53:00
I'm using an XSLT transformer to output my XML data on System.out.
Everything is printed on one line, no new lines.
Is it possible to configure the transformer to print pretty (new lines, maybe even indented)?
Here's what I have now:
TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); DOMSource source = new DOMSource(document); StreamResult result = new StreamResult(System.out); transformer.transform(source,result);
It is sorta covered in the
JavaRanch Style Guide
subject: XSLT transformer formatting
Writing XML File via Java Program
Special Characters in XML
redirect XML/DOM output to file??
xml output formatting
Convert SOAP response to SOAP XmL string using JAX WS
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014