Lists Home |
Date Index |
Kurt Cagle wrote:
> used for denoting that section. I should also point out that CDATA
> sections become almost necessary when dealing with "unsafe" content -
> XML wrappers holding blog feedbacks written by people who don't have
> the first clue about why ampersands in text are bad for your
I would say rather that CDATA sections are dangerously close to solving
the problem of wrapping unsafe content; close enough that they convince
people to use them without actually solving the problem. Three issues:
1. They cannot contain ]]>. Therefore the text must be scanned anyway to
2. They cannot contain characters from outside the current character set
(though this is not really a problem if the document is written in UTF-8
or another Unicode encoding).
3. They cannot contain most C0 control characters.
Consequently, you can't just take a random chunk of text and throw it in
a CDATA section. You might as well as use numeric character references
for this use case, and you'd be less likely to have problems if you did.
Elliotte Rusty Harold firstname.lastname@example.org
XML in a Nutshell 3rd Edition Just Published!