<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="pto" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#">
<info>
    
    
    
    
    
    
<title>What is it about CDATA Sections?</title><biblioid class="uri">http://norman.walsh.name/2003/08/24/cdata</biblioid>
<volumenum>6</volumenum>
<issuenum>75</issuenum>
<pubdate>2003-08-24</pubdate>
<date>$Date: 2005-09-11 10:27:02 -0400 (Sun, 11 Sep 2005) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2003</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>A short, cheeky complaint about the sad state of XML books.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#XML"/>
</info>

<epigraph>
<attribution>Dale Carnegie</attribution>
<para xml:id="p1">Any fool can crticize, condemn, and complain—and most fools
do.</para>
</epigraph>

<para xml:id="p2">This essay is a little bit cheeky on my part. Authors work hard,
I know from personal experience, and maybe it's unfair to judge a book
by a single section, to paraphrase a common saying. We all make
mistakes, right? I'll try to ameliorate my criticism by not mentioning
any names. But I have to ask, what is so hard to understand about
CDATA sections?</para>

<para xml:id="p3">Wandering through the book store yesterday, I paused to skim the
XML books. A few of years ago, just before the bubble burst, when the
XML books were coming out fast and furious, I happened to notice an
error in one of them. Something to do with CDATA sections, but I've
forgotten exactly what, so now when I pick up a random XML book, I
always look to see how CDATA sections are described.</para>

<para xml:id="p4">The first book I skim says that CDATA sections begin with
<quote>
      <literal>&lt;![cdata[</literal>
    </quote>. Bzzzt. Wrong, but thank
you for playing.</para>

<para xml:id="p5">The next book I pick up says that CDATA sections cannot contain
<quote>]]</quote>. Sigh. Nope.</para>

<para xml:id="p6">The third book gets it right.</para>

<para xml:id="p7">The fourth book correctly points out that CDATA sections cannot
contain <quote>
      <literal>]]&gt;</literal>
    </quote>, but fails to mention
that the string <quote>
      <literal>]]&gt;</literal>
    </quote> (unescaped)
can't ever occur in a document except when it ends a CDATA section.
Close, but no cigar.</para>

<para xml:id="p8">The last book I picked up didn't mention CDATA sections at all.
No points off, I suppose. If I promised to teach you XML in four and a
third minutes or something like that, maybe I wouldn't try to explain
CDATA sections either.</para>

<para xml:id="p9">I wonder if XML 2.0 should even contain CDATA sections?</para>

</essay>

