Boehmi
Boehmi

Reputation: 981

How do I add line breaks after each tag in MSXML?

I've created a new element/tag with doc->createElement named file, and then appended that to my files tag as a child element. After adding a few file-tags, the output in the xml file looks like this:

<file/><file/><file/><file/><file/></files>

My problem is that it isn't nicely formatted, like so:

<file/>
<file/>
<file/>

Is there any way to add whitespaces in between the elements after CreateElement and AppendChild? I've checked out Doc->put_preserveWhiteSpace, but that does just seem to set whether or not you keep whitespaces from the original XML document.

Upvotes: 1

Views: 525

Answers (1)

ankon
ankon

Reputation: 4215

Have you tried simply appending a "text" node with a new line after each <file/>?

Upvotes: 2

Related Questions