Re: Text(): Unifying DOM/Infoset/XPath/XSL

"Perry A. Caro" wrote:

> Since the XML Infoset recognizes that distinguishing CDATA sections in the
> midst of text is useful, I'd like the XPath spec to do the same.

The Infoset makes it available as an *optional* property (actually at
the moment the infoset doesn't provide enough to recreate the CDATA
sections exactly).  Optional properties provide information that is
useful for some applications but not others.  There are many other
optional infoset properties that XPath does not expose (eg entity
references).  CDATA sections and entity references are important for
some classes of application, like XML editors. However, CDATA sections
are not part of the logical structure of the XML document; the XML Rec
makes it clear that they are just another way of escaping data.  As
such, I believe it would be harmful for CDATA sections to be exposed to
XPath and thus to XSLT and XPointer.

(If anybody extends XPath to do this, cdata-section() should match only
CDATASection nodes but text() should match both CDATASectopm nodes and
text nodes, just as in the DOM the CDATASection interface extends the
Text interface.)

James

Received on Sunday, 15 August 1999 01:14:58 UTC