I'm generating an XML document in VBA using the MSXML2.DOMDocument and then sending the XML property of the object to a remote server (via POST).
The resulting string in MSXML2.DOMDocument.XML has no newlines, and so it is one big blob of XML. Is there a way to get the ouptput to put a new line after every XML element, making the file more human readable?
This isn't exactly essential, as the file received on the server is going to be immediately parsed and the information stored in an SQL database, but this would help development and testing.
You could just replace every instance of ">"
with ">" & vbCrLf
using the Replace
function before writing the file to disk.
Or you could just save the XML to disk as is and open it with Firefox or IE which should do the syntax highlighting for you.