User Id :    Password :      New Member   Forgot Password  
 
XML Parsing Error-no element found
Description The common reason for XML Parsing Error: no element found is missing closing tag for one or two html element.   No. of Views     4443
  Rating     0
Author Ahsan Murshed   Posted On     16 Jul 2010
Tags XML    

Sample Code   Download Code

XML Parsing Error: no element found

Recently when I am working with web service which returns data as XML format. But unfortunately I always found that the page always show error : XML Parsing Error: no element found. Error does not contain specific information about the source of error.

Problem:
The common reason for XML Parsing Error: no element found is missing closing tag for one or two html element, so I checked whole xml docs several times to make sure not miss any start and closing( or ) tags.

Solution:
After searching for while I found that somehow ASP.NET treat the response of page as XML document and that’s why we receive XML Parsing Error: no element found error. To solve this error I added a line
    Response.ContentType = "text/HTML"

to .cs page. This line tells ASP.NET runtime that response is HTML text and not XML.

About Author

About Author I am working as Software engineer having 4+ years of experience in Microsoft Technologies, System Design and Integration and deployment, Search Engine Optimization (SEO). I have developed web based application in asp.net/C# and database design. My Site: http://www.dotnetboss.com My blog: http://aspboss.blogspot.com Ahsan
No Photo
 
Country N/A
Company N/A
Home Page N/A

Rate this article

Rating options from poor, fair, good, very good to excelent.  
 

Comments

   
Write your comment here.
Comment
Verification Code