Re: Comments and questions on text node interface

>XPath 1.0 is quite clear that entity references must be expanded.

It says the XPath data model sees them as expanded.  The XPath model and
the DOM are not perfectly in synch in several ways; some impedence matching
must be performed to make them play nicely together.

If you'd _prefer_ to flatten your entity references first and trust that
the text node returned by the DOM XPath API is complete and self-contained
so you can use the nodeValue rather than wholeText, you're certainly free
to do so. But that will not work well for all applications of the DOM.

We can either limit the DOM's XPath API to only yield correct results on
DOMs which have been through that entity-expansion process, or we can
provide tools that allow obtaining the correct data even from DOMs which
have not. The DOM Working Group has chosen the latter, as being of greater
value to a wider range of DOM users, and has provided the wholeText
accessor to support that mode of operation.

I really think this is a case of "If you don't like it, don't use it." It's
easy to implement, and it consumes no resources unless explicitly invoked.

______________________________________
Joe Kesselman  / IBM Research

Received on Friday, 15 March 2002 11:11:13 UTC