您能否告诉我如何解决此问题:
XML文件:
<ref ref-type="sectiona">sdsadsd <email>EffectiveHealthCare@ahrq.hhs.gov</email>sdasd @ Sec asdd</ref>
<ref ref-type="sec">test Sec</ref>
<ref ref-type="sec">seesdasdasd <email>EffectiveHealthCare @ dasdasdasd</email>asdad Sec</ref>
<ref ref-type="sec"> Sec</ref>
我的代码:
XmlDocument xmlDocFile = new XmlDocument();
xmlDocFile.Load("xmlfile");
例外
引用未声明的实体'commat'。第35行,第65位
答案 0 :(得分:0)
使用此xml节点
<ref ref-type="sectiona"><![CDATA[sdsadsd <email>EffectiveHealthCare@ahrq.hhs.gov</email>sdasd @ Sec asdd]]></ref>
<ref ref-type="sec">test Sec</ref>
<ref ref-type="sec"> Sec</ref>
<ref ref-type="sec"><![CDATA[seesdasdasd <email>EffectiveHealthCare @ dasdasdasd</email>asdad Sec]]></ref>
包含无效值的节点必须进行转义<![CDATA[....]]>