1
Reply

Strange!! Unexpected end of file while parsing Name has occurred

anup daware

anup daware

Feb 6 2007 5:34 AM
7.2k
Hi Group, I am facing a strange problem here: I am trying to read xml response from a servlet using XmlTextWriter. I am able to read the read half of the xml and suddenly an exception: “Unexpected end of file while parsing Name has occurred” is being thrown. Following is the part o xml I am trying to read: 1 001 DEL_One Bridgestone HAR001 123.12 EURO 2 002 DEL_Two Firestone HAR002 453.12 EURO 3 003 FIRESTONE HAR001 24.12 EURO When I am trying to read the FIRESTONE (In Third item in the list), I am getting the “Unexpected end of file while parsing Name has occurred” exception. I am able to read the values from element for first two elements. Following is the code I am using for reading the xml. case "BRAND": if (!xmlTextReader.IsEmptyElement) productInfo.Brand = xmlTextReader.ReadElementContentAsString(); break; I also have searched net for this problem but I found nothing useful? Please let me know if I am doing something wrong or missing on something. Thanks, Anup Daware

Answers (1)