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

Re: Comments and questions on text node interface

From: Jonas Sicking <sicking@bigfoot.com>
Date: Thu, 14 Mar 2002 14:03:18 +0100
Message-ID: <002901c1cb58$9cfd6fa0$b3e0d0d9@telia.com>
To: <www-dom@w3.org>
Cc: "Ray Whitmer" <rayw@netscape.com>
Ray Whitmer wrote:
> Stefan Wachter wrote:
> > 2. replaceWholeText method
> >
> > This method has a lot of tree-processing logic that should not be
> > executed by a child node on its parent node. I would prefer the parent
> > node to have control over the process. Therefore I propose a method on
> > the node interface:
> >
> > /**
> > * Replaces the logically-adjactent text nodes always by a NEW text node.
> > */
> > public Text replaceWholeText(int anIndex); // alternatively:
> > replaceWholeText(Text aTextNode);
>
> See the above objections to using an index and the more-complex signature.

I have to ask what is the intended use for replaceWholeText? I can defenetly
see the use getting WholeText since it fits better with XPath. But chainging
it feels very awkward since it could morph big parts of tree. I think a
better way of editing a tree using an "XPath/infoset model" would be to have
users normalize the tree first and then use the normal interfaces.

/ Jonas Sicking
Received on Thursday, 14 March 2002 07:58:30 GMT

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