"EntityRef: expecting ';' at line 1"
I was using the Uber Uploader script for a project, and ran into the error above in the Firebug console. In my case, I had been passing a URL with a query string that needed to have HTML entities for the ampersands.
In other words, the following URL:
http://somesite.com/file.php?c=1&d=2&e=3was creating an error in the XML file. The ampersands had to be encoded, which solved the error:
http://somesite.com/file.php?c=1&d=2&e=3Wikipedia has a list of all the characters that must be encoded when using XML. I list them below with the symbol followed by the HTML entity you will need to use to replace it with. If you are receiving the same error (or the error "Reserved XML Name"), you most likely need to make sure that these symbols are encoded (and with the latter error, watch out for deadly white space and newline characters).
Symbol: HTML Entity: Description: " " (double) quotation mark & & ampersand ' ' or " apostrophe (= apostrophe-quote) < < less-than sign > > greater-than sign
Note that if you are using PHP, htmlspecialchars and htmlspecialchars_decode should give you everything you need for XML; for JavaScript, you'll want a custom solution such as this one.
Wow, it took me so long to get this figured out. Thank you for sharing, this helps me out so much!
ReplyDeleteThank you!
ReplyDeletethanks
ReplyDeletevapor4less.com/index.php?route=feed/google_sitemap
ReplyDeletePlz help
Don't know how your site feed setup works, so will only be of limited help.
ReplyDeleteFirst, here's the error you're getting for everyone else to view:
This page contains the following errors:
error on line 1 at column 2396: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.
Your error only means one thing: the XML interpreter has encountered invalid syntax for one of these five symbols: ", &, ', <, or >.
In your case, the "&"s in your URLs are primary suspects., beginning at column 2396 where the error occurred.
Thank you! It's valid now!
ReplyDeleteWhat if it says
ReplyDeleteThis page contains the following errors:
error on line 61 at column 187: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.
??
Thanks. Great Help. :)
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHow to remove remove entity error in hyper link Part Time jobs in Tamilnadu
ReplyDeleteThanks Sir
ReplyDelete[url=https://www.graana.com/area/411/capital-smart-city][capital smart city][/url]
ReplyDeleteexcellent keep it up