| Author: Lalji 05 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
You get this error if your XML contains non ASCII characters, and the file was saved as single-byte ANSI (or ASCII) with no encoding specified
more about this error -------------- http://geekswithblogs.net/influent1/archive/2007/06/29/113594.aspx
|
| Author: Anuraj 05 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
Check this link
http://support.microsoft.com/kb/238833
Thanks Anuraj THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS. BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT. dotnetthoghts
|
| Author: Dhanesh.K.R 05 Nov 2009 | Member Level: Bronze | Rating:  Points: 2 |
There may be some character entry mistakes
Try this link
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entities_in_XML
|
| Author: Zelalem 15 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
The XML works fine. I test it as is. Please see the code First you need to add system.xml namespace
XmlDocument xdoc = new XmlDocument(); xdoc.Load(@"D:\WPF_Projects\ConsoleApplication2\XMLFile1.xml"); XmlNodeList list = xdoc.GetElementsByTagName("Program"); foreach (XmlNode node in list) {
}
remember, my xml is just an xml file that contains your xml element without any modification. <?xml version="1.0" encoding="utf-8" ?> <Program funcNbr="80000426" Desc="Meter Reading" FullName="TWACS – Meter Reading" Grouping="6" PrgmMnemonic="TWPB" PrgmGroup="PUB" PrgmName="TWACMDSK" UpdateFlg="Yes" ExclAccessFlag="No" OptAvailable="1" HelpIndex="1" System="CA" HelpFile="Help/Under_Development_2.htm" RptColumns="132"> </Program> So the problem might be somewhere else. I will be glad to see details of the error message you recieved. Please see the attached screenshot i took during debugging of the app that loads and parses the above xml file.
xmlForum.docx |