小编Fun*_*nky的帖子

XmlDocument不会在标记之间保存空格

XML的一部分:

<text:p>text1 <text:span>text2</text:span> <text:span>text3</text:span>text4</text:p>
Run Code Online (Sandbox Code Playgroud)

您可以在text:span标记与text2和text3之间看到空格.当我调用XmlDocument.Load方法时,我有这样的图片:

<text:p>text1 <text:span>text2</text:span><text:span>text3</text:span>text4</text:p>
Run Code Online (Sandbox Code Playgroud)

白色空间被移除了,但我在这个地方需要这个空间.设置属性"PreserveWhitespace = true"没有帮助

.net xml xmldocument

4
推荐指数
1
解决办法
1410
查看次数

标签 统计

.net ×1

xml ×1

xmldocument ×1