Using java Syntax Highlighting
- TransformerFactory tf = TransformerFactory.newInstance();
- tf.setAttribute("indent-number", new Integer(4));
- Transformer t = tf.newTransformer();
- t.setOutputProperty(OutputKeys.INDENT, "yes");
- t.setOutputProperty(OutputKeys.METHOD, "xml");
- t.setOutputProperty(OutputKeys.MEDIA_TYPE, "text/xml");
- t.transform(new DOMSource(yourDOMDocument), new StreamResult(new OutputStreamWriter(yourFileOutputStream)));
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
In Android there aren't APIs for XSLT, so, how can I write a Document to file?
In my Android application I have to create an XML document, but I don't want to
create it manually with strings, I want to create it with DOMDocument interface.
The problem is that I don't know how can I write it in an OutputStream.
Thank-youvery much.




