special charcters in XML, in ASP.net???
-
Hi, I am trying to read an XML file using XmlDocument.LoadXml() function, in ASP.net. This xml has data which contains special characters like ampersand (&). But it fails saying "An error occurred while parsing EntityName. Line 1, position 31." How can I make this xml string valid before passing to LoadXML() function. Please advise. Thanks Pankaj
Follow your goals, Means will follow you ---Gandhi---Pankaj -
Hi, I am trying to read an XML file using XmlDocument.LoadXml() function, in ASP.net. This xml has data which contains special characters like ampersand (&). But it fails saying "An error occurred while parsing EntityName. Line 1, position 31." How can I make this xml string valid before passing to LoadXML() function. Please advise. Thanks Pankaj
Follow your goals, Means will follow you ---Gandhi---PankajIf the xml file contains these special characters, it is not valid xml. You will need to replace these characters with their escaped verions. Have a look in MSDN or on www.w3c.org for the complete list. Some I can remember are; & - & " - " < - < > - >
-
If the xml file contains these special characters, it is not valid xml. You will need to replace these characters with their escaped verions. Have a look in MSDN or on www.w3c.org for the complete list. Some I can remember are; & - & " - " < - < > - >
Hmm. CodeProject has rendered the escaped characters ... Try again & - & " - " < - < > - >
-
If the xml file contains these special characters, it is not valid xml. You will need to replace these characters with their escaped verions. Have a look in MSDN or on www.w3c.org for the complete list. Some I can remember are; & - & " - " < - < > - >
-
Thanks for the reply. Actually, I found the solution. All we need to do is add following as the first line in xml: This will take care of it. :)
Follow your goals, Means will follow you ---Gandhi---Pankaj -
If the xml file contains these special characters, it is not valid xml. You will need to replace these characters with their escaped verions. Have a look in MSDN or on www.w3c.org for the complete list. Some I can remember are; & - & " - " < - < > - >