The Wrecking Bawl

Destructuring query language, one keyword at a time.


News


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''?>'

 


Comments

Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Ethan Nagel on 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.
Posted by ozzie on 11/14/2007 2:03 AM
Thank you.. works perfectly now :)
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by nashaad on 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.
Posted by Bud on 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.
Posted by Gaurang Thakkar on 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.
Posted by mwpolitics on 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.
Posted by Gaurav296 on 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.
Posted by Sivaprakasam.V on 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.
Posted by Janarthanan on 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.
Posted by Abdul Raseed on 11/16/2009 6:19 PM
Thanks, it reaaly helps me.
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Michael on 11/18/2009 3:18 AM
Great, it worked for me!!!
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by RichardB on 2/4/2010 10:33 PM
I have the same problem. It seems to be related to the size of the text stream being returned. Still testing but that seems to be the only logical explanation for now. Also have the "ISO" setting
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Tim on 6/3/2010 8:24 PM
Great article!. I have the same problem and your solution really help me to generate feed on my site. Thank
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by bem on 11/14/2010 4:09 AM
hi, i've got no error messages, but the parser simply stop working while encounter the "&" character...
any ideas?

thanks a lot!
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by sajid on 12/29/2010 11:26 PM
Worked for me toooooooo :-) thanks!!!
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Eknath on 2/3/2011 10:01 PM
Wow! Great..! Worked perfectly.
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Loul13 on 11/10/2011 3:12 AM
Thanks man!
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Sagar Dasgupta on 1/16/2012 11:17 PM
It worked.. Thanks Buddy...
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by SeDuKtIvE s0uL on 3/8/2012 3:18 PM
I get this message while browsing on my blackberry "Error encountered during XML parse: Invalid character '&#x19' encountered." Can anyone help please
Gravatar # re: XML parsing error: An invalid character was found in text content.
Posted by Brian Besthorne on 1/10/2013 6:43 AM
Great tip, this worked perfectly.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: