我正在通过 System.Xml.XmlWriter 编写一个包含一些 XML 的字符串。我被困在使用 WriteString() 和文档中:
WriteString does the following: The characters &, <, and > are replaced with &, <, and >, respectively.
我希望停止此操作,但我似乎找不到任何 XmlWriterSettings 属性来控制此行为。有哪些解决方法?谢谢!
大卫
最佳答案
尝试将您的真实内容包装在 CDATA 标签之间:
<![CDATA[ 这是我的内容 ]]>
关于c# - 通过 System.Xml.XmlWriter 转义尖括号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66479/