问题描述
我尝试将rtf字符串放在XmlElement的InnerText属性中,并使用 sp_xml_preparedocument将生成的OuterXml传递给sql,但SQL无法加载文档。当我使用COM MSXML2命名空间中的等效对象替换System.Xml命名空间的所有实例时,SQL能够解析生成的xml字符串。为什么.Net XmlDocument在涉及rtf时无法生成有效的xml,其他解析器在哪里工作?是否只是我在XmlDocument上缺少的设置?
I tried putting an rtf string in the InnerText property of an XmlElement and passing the resulting OuterXml to sql to load using sp_xml_preparedocument, but SQL was unable to load the document. When I replaced all instances of the System.Xml namespace with the equivilant objects in the COM MSXML2 namespace, SQL is able to parse the resultant xml string. Why does the .Net XmlDocument fail to produce valid xml when rtf is involved, where other parsers work? Is there simply a setting I am missing on XmlDocument?
推荐答案
这篇关于为什么XmlDocument.OuterXml在包含RTF文本时会产生与其他Xml Parser不兼容的xml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!