Closed GoogleCodeExporter closed 9 years ago
add to TomXmlUtils
Original comment by brito....@gmail.com
on 29 Mar 2010 at 2:28
if Document extends Node, why throws an exception when trying to use
com.sun.org.apache.xml.internal.security.utils.XMLUtils.outputDOM(Node
contextNode,
OutputStream os)?
Original comment by brito....@gmail.com
on 29 Mar 2010 at 2:35
[deleted comment]
Improved method:
// This method writes a DOM document to a stream
public static void outputDOM(Document doc, PrintStream stream)
throws TransformerFactoryConfigurationError, TransformerException {
// Prepare the DOM document for writing
Source source = new DOMSource(doc);
// Prepare the output stream
Result result = new StreamResult(stream);
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.setOutputProperty(OutputKeys.INDENT, "yes");
xformer.transform(source, result);
}
Original comment by brito....@gmail.com
on 29 Mar 2010 at 6:10
Original comment by brito....@gmail.com
on 9 Apr 2010 at 1:18
Original issue reported on code.google.com by
brito....@gmail.com
on 29 Mar 2010 at 2:26