Harrie <sp*****@linux.org.invalid> wrote:
You'll also need to do this for the < and > characters (< and >).
And single and double-quotes, see:
"What are the special characters in XML?"
http://xml.silmaril.ie/authors/specials/
This is going too far. You are saying that we need to escape all of these
characters. The cited document explains the situation better. The details are
somewhat complicated, but the short story is (using the loose word "escaped"
to mean "written as an entity reference or as a character reference"):
1) "&" must always be escaped when not used in its special XML meaning
2) "<" must always be escaped when not used in its special XML meaning
3) ">" does not need to be escaped, but may be escaped when not used
in its special XML meaning; in CDATA sections, it must be escaped
for compatibility
4) the Ascii quotation mark " does not need to be escaped (but may be escaped
when not used as an attribute value delimiter), except in the special case
where it appears inside an attribute value delimited by Ascii quotation
marks
5) similarly for the Ascii apostrophe '.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/