I need to read some XML from a 3rd party source. None of their text fields are wrapped in CDATA 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?
Share
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