[XML-SIG] Change in reporting of CDATA sections

Bob Kline bkline at rksystems.com
Tue May 18 16:46:14 EDT 2004

On Tue, 18 May 2004, "Martin v. Löwis" wrote:

> Ah, just ask :-) The current implementation tries to implement the DOM
> Level 3 Load-Store specification, which gives the application control
> over various details of how precisely the DOM tree is created. 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).
> The old implementation did not create CDATA section nodes, because,
> when it was first implemented, minidom did not even have CDATA section
> nodes. When they were added, the creation process was not changed.
> In any case, the old implementation also predates DOM L3 LS (but that
> is not the reason for not creating CDATA section nodes).

Thanks very much, Martin.  This clears things up considerably.  I hadn't
gotten around to digging into the DOM3 specs (earlier Python's xml.dom
having been based on DOM Level 2), and to be honest I never was
successful in figuring out whether the earlier DOM specifications
spelled out unambiguously whether a DOM parser was allowed to silently
transform CDATA sections into text nodes.  I do remember being surprised
when I first discovered that the minidom implementation was doing this
(and presumably the programmer who wrote the code in our system that was
broken by the new behavior was also surprised to see text nodes coming
back where he knew that the parsed document had CDATA sections was
equally surprised).  Did the earlier versions of the DOM spec allow
this, or was that just a bug in the implementation?

Bob Kline
mailto:bkline at rksystems.com

More information about the XML-SIG mailing list