Invalid characters for AJAX script
January 19, 2006
/ Filed under: XML
I kept getting an XML "not well formed" error in the Firefox JavaScript console. Well-formed, I wondered? What do you mean? My XML elements were nested properly, and they all had start and end tags. Ha. Silly me. I was confusing "well formed" with "valid."
My problem? I was forgetting to "escape" certain characters - specifically the ampersand (&). If you don’t escape the ampersand with an Ascii equivalent, your XML parser will spit up your file, in most unpleasant ways. I typically use & - but you can also use &.
Comments/Mentions
|
Editor Picks
Email NewsletterSubscribe to the digest newsletter to receive posts by email: Recent Comments
Advertisements
|