Re: Comments and questions on text node interface

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 UTC