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:
&%;
It should be:
&
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.
精彩评论