I have an instance of MSXML2.DomDocument.
I wave to save it, with indenting.
This code works, but does not indent:
var dom = new ActiveXObject("MSXML2.DomDocument");
// fiddle with dom here
dom.save(filename);
I think I can use an MXXMLWriter object to inject indenting.
How?
This oughta do it.
Use it like this:
I could not figure out how to adjust the indent level. It always indents with a tab.
If you don't want to use xsl, you could just insert vbcrlfs. Every ">" should follow vbcrlf, except when ">" is followed by a number. Then create new xml file from that string - now it has new lines and indents. msaccess vba:
create document with objDom.append, then play with string(my xml had just numbers):
There is another way to prettifying xml outputs, plus you can adjust the indent level manually : XSL.
indent.xsl