开发者

why percent sign is not accepted in some cases in xml-text field when xml is deserialized with C#

<name>Hello '"world", ü ë &a开发者_运维技巧mp;amp%;</name>
<label>''MHU233%;'</label>

XmlSerializer.Deserialize(XmlReader) throws an InvalidOperationException in first case above. Would like to know what is wrong and why latter is ok. XmlReader is created with XmlSettings in constructor where Xml-schema is in SchemaSet.

Thanks!


You've got an invalid entity there:

&amp%;

It should be:

&amp;

The & says it's the start of an entity. There's no entity called amp% which is why you've got a problem - indeed, percent signs aren't even allowed in entity names. Basically your input XML file is invalid.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜