【发布时间】:2014-05-30 14:55:13
【问题描述】:
我在从 XML 文件中读取 & 符号时遇到问题:
XElement xmlElements = XElement.Load(Path_Xml_Data_File);
当我遇到错误时:
<Name>Patrick & Phill</Name>
Error: Name cannot begin with the ' ' character, hexadecimal value 0x20. Xml.XmlException) A System.Xml.XmlException was thrown: "Name cannot begin with the ' ' character
或使用特殊的葡萄牙语字符:
<Extra>Direcção Assistida</Extra> (= <Extra>Direcção Assistida</Extra>)
Error: Reference to undeclared entity 'ccedil'
知道如何解决这个问题吗?
【问题讨论】:
标签: c# xml xml-parsing