Posts
120
Comments
117
Trackbacks
22
XML parsing error: An invalid character was found in text content.

So I was writing a script to pull out some old xml data, and I happened upon this error:

XML parsing error: An invalid character was found in text content.

It probably would have taken me centuries to figure out what character it didn't like, so I tried concatenating the following line to the front of the xml column in the SELECT statement I used to populate the cursor for openxml, and voila, no more error!  I guess bumbles really do bounce.

'<?xml version=''1.0'' encoding=''iso-8859-1''?>'

 

posted on Friday, June 29, 2007 11:26 AM Print
Comments
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Ethan Nagel
11/1/2007 7:02 AM
I was struggling with the same problem and I happened to google across your blog. It worked perfectly! Thanks!

- Ethan
Gravatar
# re: XML parsing error: An invalid character was found in text content.
ozzie
11/14/2007 2:03 AM
Thank you.. works perfectly now :)
Gravatar
# re: XML parsing error: An invalid character was found in text content.
nashaad
9/9/2008 8:32 PM
Thanks that worked for me as well!
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Bud
11/10/2008 2:02 AM
Well, add me to the list. Made the change, and my program worked perfectly. Thanks so much!
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Gaurang Thakkar
11/15/2008 7:27 PM
I am having exactly same error message: "An invalid character was found in text content. "
I tried having below code as first line of my xml file but it did not resolve my issue.
'<?xml version=''1.0'' encoding=''iso-8859-1''?>'
Do you think of any other cause and resolution of the same error message ?

Thanks,
Gaurang.
Gravatar
# re: XML parsing error: An invalid character was found in text content.
mwpolitics
2/2/2009 4:50 AM
My XMl used to display with strange characters for some spaces in Firefox and Chrome, and would show the invalid character message and not display at all in IE. When I changed the encoding to iso-8859-, it displayed perfectly in the other browsers, and it at least shows up in IE, but in IE I see little boxes where some spaces should go!

It's an improvement, but what next?
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Gaurav296
3/16/2009 2:38 AM
Hi There,
I am Gaurav.
I am also facing the same probelm of character encoding and just to mention my character encoding is already set to ISO-8859-1.
But still i am facing the probem for rendering Italian character.
Please help to tackle this :)

-Gaurav
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Sivaprakasam.V
5/20/2009 9:05 PM
I am also facing the same probelm of character encoding and just to mention my character encoding is already set to ISO-8859-1.
But still i am facing the probem for rendering Italian character.
Please help to tackle this :-)
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Janarthanan
7/13/2009 5:51 AM
Thanks for the solution.
It really works for my situation.
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Abdul Raseed
11/16/2009 6:19 PM
Thanks, it reaaly helps me.
Gravatar
# re: XML parsing error: An invalid character was found in text content.
Michael
11/18/2009 3:18 AM
Great, it worked for me!!!

Post Comment

Title *
Name *
Email
Url
Comment *  
 
News