문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top