Geeks With Blogs

News
The Wrecking Bawl Destructuring query language, one keyword at a time.

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 all tech stuff , SQL Server | Back to top


Comments on this post: XML parsing error: An invalid character was found in text content.

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
I was struggling with the same problem and I happened to google across your blog. It worked perfectly! Thanks!

- Ethan
Left by Ethan Nagel on Nov 01, 2007 7:02 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Thank you.. works perfectly now :)
Left by ozzie on Nov 14, 2007 2:03 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Thanks that worked for me as well!
Left by nashaad on Sep 09, 2008 8:32 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Well, add me to the list. Made the change, and my program worked perfectly. Thanks so much!
Left by Bud on Nov 10, 2008 2:02 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
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.
Left by Gaurang Thakkar on Nov 15, 2008 7:27 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
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?
Left by mwpolitics on Feb 02, 2009 4:50 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
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
Left by Gaurav296 on Mar 16, 2009 2:38 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
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 :-)
Left by Sivaprakasam.V on May 20, 2009 9:05 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Thanks for the solution.
It really works for my situation.
Left by Janarthanan on Jul 13, 2009 5:51 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Thanks, it reaaly helps me.
Left by Abdul Raseed on Nov 16, 2009 6:19 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Great, it worked for me!!!
Left by Michael on Nov 18, 2009 3:18 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
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
Left by RichardB on Feb 04, 2010 10:33 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Great article!. I have the same problem and your solution really help me to generate feed on my site. Thank
Left by Tim on Jun 03, 2010 8:24 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
hi, i've got no error messages, but the parser simply stop working while encounter the "&" character...
any ideas?

thanks a lot!
Left by bem on Nov 14, 2010 4:09 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Worked for me toooooooo :-) thanks!!!
Left by sajid on Dec 29, 2010 11:26 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Wow! Great..! Worked perfectly.
Left by Eknath on Feb 03, 2011 10:01 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Thanks man!
Left by Loul13 on Nov 10, 2011 3:12 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
It worked.. Thanks Buddy...
Left by Sagar Dasgupta on Jan 16, 2012 11:17 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
I get this message while browsing on my blackberry "Error encountered during XML parse: Invalid character '&#x19' encountered." Can anyone help please
Left by SeDuKtIvE s0uL on Mar 08, 2012 3:18 PM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Great tip, this worked perfectly.
Left by Brian Besthorne on Jan 10, 2013 6:43 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
We are getting error as An invalid XML character '01xa' found in documnet containt. We are calling XML parser when request is sent from Java front end to Mainframe as backend via webservice. Can you please help how we can resolve this.
Left by taniya on Sep 27, 2013 6:17 AM

# re: XML parsing error: An invalid character was found in text content.
Requesting Gravatar...
Well, I had the same problem with a settings.xml - make a copy of the original "trouble making one" , delete the original - and see if the program wrights a new correct one. For me that worked.
Left by Andy on Dec 14, 2013 4:26 AM

Your comment:
 (will show your gravatar)
 


Copyright © Alex Bransky | Powered by: GeeksWithBlogs.net | Join free