RE: Question for implementors: XPath model and CDATA sections

Xalan's behavior when run against a DOM is essentially
identical (in this regard) to that of the proposed DOM XPath
API. You might want to review that, and the reasons behind
it, before deeming it wrong.

Basically: The DOM and XPath data models do not agree. A
single XPath text node may be made up of multiple DOM nodes,
due to CDATA Section markup and entity references and simple
history of how that DOM was constructed. If you ask XPath to
give you the location of an XPath text node within a DOM in
DOM terms, the best that can be done is to give you the node
in the DOM where that text starts, plus a convenience method
to retrieve the entire block of text.

Yes, we could return an aggregating pseudo-node -- but
that's less convenient for folks who actually want to use
the XPath to find a place in the DOM and then continue
operating on the DOM API and is really no cleaner.

Received on Tuesday, 12 February 2002 10:23:08 UTC