Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 System.Xml.XmTextWriter 创建类似 xml 的标记语言,第三方应用程序将读取该语言。
在这种标记语言中,符号 > 和 < 在元素内时,需要显示为,但 XmlTextWriter 将它们转换为 > 和 < ; (没有空格,我只是因为这里的格式而添加了那些)。
关于如何在仍然使用 XmlTextWriter 的同时防止这种情况的任何想法?
您可以使用 XmlTextWriter.WriteRaw 方法输出原始 XML(无转义)。
http://msdn.microsoft.com/en-us/library/z7sb8fsy.aspx