I have a project in which I get xml posted via a hidden form field (data=<xml></xml>). People are entering names like Bill & Sandy Smith. this is coming over as:
<NameInfo><FamilyName><FamilyNames>David & Karen</FamilyNames><Surname>Adams</Surname></FamilyName></NameInfo>
When I try to load this up in a XmlDocument it blows up.
string xmlData = Request.Form["RequestData"];
dom.LoadXml(xmlData);
results with this:
"This is an unexpected token. The expected token is 'EndElement'. Line 1, position 1022."
I really don't want to go and put some hack in like replacing any & with a + or something like that. But every diferent way I try to load the string blows up.
--------------------------------
From: Eric Zechman
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>uSYzhMD9w0yby494o3XxHg==</Id>