Last post May 15, 2012 02:10 AM by itspandith
Feb 17, 2012 05:02 PM|ianaellis|LINK
The error: "Unhandled Exception: System.Xml.XmlEception: 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 168, Position 3."
XmlTextReader reader = new XmlTextReader("C:\\xml\\xmlTest.xml");
endnotesID = reader.Value.Trim();
I've checked my file several times and in several ways, there is no white space before the first node ( <?xml version="1.0" encoding="UTF-8" ?> ).
I feel like I'm missing something really small, any ideas?
Feb 17, 2012 05:21 PM|AZMatt|LINK
Do you have the symbol "<?" somewhere else in your XML file... like on Line 168?
If not, can you post your XML?
Feb 17, 2012 05:48 PM|ianaellis|LINK
Thank you for the reply. That was the problem... I didn't even look for that and its been over an hour.
May 15, 2012 02:10 AM|itspandith|LINK
Thanks ! That helped !!