at the moment im loading xml and i am getting error:
System.Xml.XmlException: ‘ ‘,
hexadecimal value 0x17, is an invalid
character. Line 2762, position 16.
it is easy to fix. just open xml and remove the character.
but I need to know is it possible to load xml even with invalid characters and use it for parsing.
and is there any downside?
xml example:
<?xml version="1.0" encoding="UTF-8"?>
<all>
<sub>
<summary>this is summary and it might have some invalid chars</summary>
</sub>
<sub>
<summary>this one is ok</summary>
</sub>
</all>
not sure exactly how it works in c# but if you could some how get it to parse an xml from a ‘string’ not a file, you could first load the file into a ‘string’ filter the string yourself, then send it off for xml parsing.
Edit:
maybe ‘string’ is a poor choice, as the corrupt data might have NULLs in it ect, A byte array or some other generic memory stream structure?