P
pavel.orehov
Hi,
I am saving created XML to a file but when I open the file with
nodepad, for instance, I see all the XML in one line.
It is not well formatted/alignment.
Only when I open it with IExplorer I see it okey.
This is the code of saving:
doc.getDocumentElement().normalize();
DOMSource ds = new DOMSource(doc);
StreamResult sr = new StreamResult(out);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer trans = tf.newTransformer();
trans.transform(ds, sr);
Does anyone knows how should I save the XML to file so that the XML
file will be well formatted ?
Thanks,
Pavel
I am saving created XML to a file but when I open the file with
nodepad, for instance, I see all the XML in one line.
It is not well formatted/alignment.
Only when I open it with IExplorer I see it okey.
This is the code of saving:
doc.getDocumentElement().normalize();
DOMSource ds = new DOMSource(doc);
StreamResult sr = new StreamResult(out);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer trans = tf.newTransformer();
trans.transform(ds, sr);
Does anyone knows how should I save the XML to file so that the XML
file will be well formatted ?
Thanks,
Pavel