Julien Baldy
Julien Baldy

Reputation: 427

How to keep carriage with XML save in VBS

I use

Set xmlDoc = CreateObject("Microsoft.XMLDOM")

in my VBS to edit an XML. At the end, when I update my specific line in my XML file, I use

strResult = xmldoc.save(strFile)

The problem is, my XML file (before edit) has a carriage but after the .save() method the entire carriage returns disappears.

How can I keep them? It is possible?

Upvotes: 0

Views: 330

Answers (1)

Kevin Collins
Kevin Collins

Reputation: 1461

You can set the preserveWhiteSpace property of the document object to true.

xmldoc.preserveWhiteSpace = true

Upvotes: 2

Related Questions