defa0009
asked on
XML Pretty Printing...
I am trying to set the indenting of an xml doc so it is easily readable but it is not working?
I would like to stick with the javax.xml.transform classes...
Here is the code I am using
private void indentXML(Document doc){
try{
Transformer trans = TransformerFactory.newInst ance().new Transforme r();
trans.setOutputProperty(Ou tputKeys.I NDENT, "yes");
trans.transform(new DOMSource(doc), new StreamResult(System.out));
}catch(Exception e){}
}
I would like to stick with the javax.xml.transform classes...
Here is the code I am using
private void indentXML(Document doc){
try{
Transformer trans = TransformerFactory.newInst
trans.setOutputProperty(Ou
trans.transform(new DOMSource(doc), new StreamResult(System.out));
}catch(Exception e){}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER