Is CDATA "structure"?

Paul Prescod paul at prescod.net
Thu Jul 15 19:31:25 BST 1999


Tom Otvos wrote:
> 
> 
> So, my question is should CDATA sections in an XML document be considered
> structural, and warrant being displayed in an XML editor, or should they be
> considered more like "parser control" and be silently interpreted in the
> same way that entity encodings are?  Although we cannot change the way the
> current crop of XML editors behaves, it would be nice to know what the
> conventional wisdom *thinks* should be happening.

I'm confident that our XML 1.0 intent was that CDATA sections should be
even less "physical" than entity references. They were just a markup
convenience with no semantic significance. But XML editors are somewhat of
a funny tool category. They are supposed to hide structure from you, "but
not really." The problem is that different authors have different levels
of interest in the details of the encoding. Because of this, the DOM tends
to err on the side of providing more information rather than less. In
other words, it requires the parser to tell the application more than has
historically been the case.

The long and short of it is that I don't think that there is anymore a
real distinction between the "physical" and "logical"aspects of a
document. You need to actually know what your downstream apps will
consider significant. If you don't want to think about your downstream
apps then of course you can just presume that everything is significant. 

The ISO world has a concept of "grove plan." This is a formal declaration
of the sensitivity of a particular application. By applying a grove plan
to a grove (for instance in a grove API or in a query/address) you can
reduce the sensitivity of an application and thus make (e.g.) CDATA and
entity reference nodes disappear. In the W3C world we just hard-code
sensitivity into our APIs and query/addressing languages. So the DOM is
hard-coded to support CDATA and entity references but XPath is hardcoded
NOT to. Yes, that's a little confusing.

If you could apply a grove plan to your text editor then YOU could decide
whether CDATA sections are structural or not for your application.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

To me programming is more than an important practical art. It is
also a gigantic undertaking in the foundations of knowledge.
	- Grace Hopper

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list