I’m getting an error in deserialize xml, where there is “<” “>” instead of “<”, “>”.
I used to decode:
system.web.HttpUtility.HtmlDecode(string)
but it throws illegal character error
“Deserialize xml: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 5, position 34.”
Error after decode:
Deserialize xml: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 5, position 34.
read the value from the doSelectReturn Element into a string Variable - strContent
decode the Entities - strContentDecoded
Deserialize strContentDecoded
do the Extraction of element values as needed
When decoding the entities before the first deserialization then the content of doSelectReturn is seen as a second XML and causes this issue / Exception