Parser for .NET that will handle invalid XML [duplicate]
I need to read some XML from a 3rd party source. None of their text fields are wrapped in CDA开发者_运维知识库TA tags, and they can't guarantee that the values won't include invalid characters--I'm particularly thinking of ampersands. They also won't add CDATA tags, because that might break things for their existing clients. Is there a parser out there that would handle this?
Assuming the invalid characters are properly escaped, not included literally in the XML, you can read it with the .NET library by creating an XmlTextReader with the Normalization property set to false. See http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader.normalization.aspx
精彩评论