XML
What are the invalid characters in XML??
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Puran KaushalRank #2,456 · 573 reputationPosted Jul 7, 2008, 3:12 AM EDT
Hi
The characters "&" and "<" are reserved in XML as what are called "open markup delimiters" -- that is, they are the characters recognized by XML processors as indicating that what follows is markup, not data. Hence they can't be used as plain characters.
XML provides for character references, which you can use to work around this. For "<" use the reference "<" (that's "& l t ;" for those with overzealous email clients) and "&" (that's "& a m p ;") for "<" and "&" respectively.
If you'd like to read a rationale and deeper explanation for all this, take a look at http://xmlshoestring.com/xml101/wfrules.
Regards
Puran