[
Lists Home |
Date Index |
Thread 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
> application
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
be safe.
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 elharo@metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
|