Answer the question
In order to leave comments, you need to log in
How to save formatted XML with comments using MSXML2.MXXMLWriter from VBScript?
There is VBScript that creates an XML file.
To make the XML look human readable, I use MSXML2.MXXMLWriter. But when using this library, all comments are removed from the XML.
I create comments like this:
Set xmlParser = CreateObject("Msxml2.DOMDocument")
'Создание объявления XML
xmlParser.appendChild(xmlParser.createProcessingInstruction("xml", "version='1.0' encoding='windows-1251'"))
'Создание комментария
xmlParser.appendChild(xmlParser.createComment("Текст комментария"))
xmlParser.save("C:\Test.xml")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question