W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2002

Re: Comments and questions on text node interface

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Fri, 15 Mar 2002 11:10:19 -0500
To: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Cc: www-dom@w3.org
Message-ID: <OFE67C5453.FC537566-ON85256B7D.005840A7@pok.ibm.com>

>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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT