[XML-SIG] Change in reporting of CDATA sections

Andrew Clover and at doxdesk.com
Tue May 18 17:47:40 EDT 2004

Martin v. Löwis <martin at v.loewis.de> wrote:

> One such detail is whether CDATA sections are represented
> by text nodes or CDATA section nodes. The default for this setting
> is "on" (i.e. do create CDATA section nodes).

In general, the default for the parameter 'cdata-sections' is indeed 
True. However, due to a well-hidden trap in the Load/Save spec, parsing 
operations default 'cdata-sections' to False:

   LS #parameter-infoset:

     See the definition of DOMConfiguration for a description of this
     parameter. Unlike in [DOM Level 3 Core], this parameter will default
     to true for LSParser.

   Core #parameter-infoset:

     This forces the following parameters to false: "validate-if-schema",
     "entities", "datatype-normalization", "cdata-sections".

So by default both CDATA sections and entity references (which don't 
currently happen in minidom anyway) should not be generated.

 > I personally think that CDATA sections are a mistake. They
 > shouldn't have been in XML, and people should not use them.

I kind of agree; their use-case is very marginal. Typing a few extra 
&lt; and &amp;s is not usually much of a hardship even to hand-coders.
I would have liked to have seen XML lose all the nonsense about DTDs, 
default attributes and entity references too, but it's a bit too late now!

Andrew Clover
mailto:and at doxdesk.com

More information about the XML-SIG mailing list