I am trying to bind xml dataset to a grid. But getting following error.
System.Xml.XmlException: Reference to undeclared entity 'nbsp'. Line 91, position 27. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32
linePos) at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos) at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue,
EntityExpandType expandType, Int32& charRefEndPos) at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.ParseText() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text,
LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text) at
<div>Hello,</div> <div></div> <div>How are you? I sent you the code and I have hardcoded the login details in the code.</div> <div>Did you get enough free time to check my code? If you can advice me for that, then that would be really appreciate.</div> <div></div>
<div>Thank you very very much!</div> <div>Tnx</div>
<div>Hello,</div> <div></div> <div>How are you? I sent you the code and I have hardcoded the login details in the code.</div> <div>Did you get enough free time to check my code? If you can advice me for that, then that would be really appreciate.</div> <div></div>
<div>Thank you very very much!</div> <div>Tnx</div>
Sorry plz resend it, I didn't receive it……
Please make sure that there's no syntax error and I can run it first.
maduranga001
Member
162 Points
235 Posts
XML Error
Nov 23, 2011 06:57 AM|LINK
I am trying to bind xml dataset to a grid. But getting following error.
System.Xml.XmlException: Reference to undeclared entity 'nbsp'. Line 91, position 27. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos) at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos) at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos) at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.ParseText() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text) at
I saw the same error in this page.
http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/8eb35bcc-a620-4b16-b7ba-68ecc5fde10a/
and here..
http://code.google.com/p/reader-notifier-mod/issues/detail?id=8
But I can not find how to fix it in this application.
This is the code currently running..
void viewTickets() { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(_myDomain + "/requests.xml"); // working for - rules/651263.xml request.Method = "GET"; request.Credentials = new NetworkCredential(_Username, _Password); request.ContentLength = 0; HttpWebResponse resp = (HttpWebResponse)request.GetResponse(); StreamReader reader = new StreamReader(resp.GetResponseStream()); string tmp = reader.ReadToEnd(); XDocument Xdoc = XDocument.Parse(tmp); //Run query var result = (from etickets in Xdoc.Descendants("record") select new MyModel { eNiceId = _myDomain + "/records/" + etickets.Element("nice-id").Value, Subject = etickets.Element("subject").Value, Status = GetTicketStatus(etickets.Element("status-id").Value) ,Description = etickets.Element("description").Value }).ToList(); GridView1.DataSource = result; GridView1.DataBind(); }Tnx
Appreciate if you can advice. Please help ! Thanks!
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: XML Error
Nov 25, 2011 12:32 AM|LINK
Hello:)
Plz show us your whole complete xml contents. I guess there must be something wrong with that.
PS:I haven't received your proj.
maduranga001
Member
162 Points
235 Posts
Re: XML Error
Dec 04, 2011 06:53 AM|LINK
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: XML Error
Dec 04, 2011 07:20 AM|LINK
Sorry plz resend it, I didn't receive it……
Please make sure that there's no syntax error and I can run it first.