So I have some XML:
<key>my tag</key><value>my tag value and my invalid Character</Value>
and an XMLReader:
using (XmlReader reader = XmlReader.Create(new StringReader(xml)))
{
while (reader.Read())
{
//do my thing
}
}
I have implemented the CleanInvalidCharacters method from here but as the "" is not yet encoded it doesn't get removed.
The error is being thrown at the reader.Read(); line with exception:
hexadecimal value 0x0B, is an invalid character.