Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] removeChild returns what?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT a.cs.okstate.edu>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] removeChild returns what?
  • Date: Sun, 04 May 2003 09:42:54 -0500

Elliotte Rusty Harold writes:

> That is, should they be changed to:
>
> public Node removeChild(int position)
> public Node removeChild(Node child)

+1, I said most of the time if you remove a node, you're going turn
right around and either reattach it in a different location or to a different
document. Just removing it and never doing anything sounds like filtering
that sould be done on build.

> Second question: does it make sense for both methods to return the node
> removed? or just the one that removes by position? After all, when the
> method removes a specific child node, you must already have a reference
> to that node. Then again, it may be conceptually cleaner for both
> removeChild methods to return the same thing. Thoughts?

IMHO a consistent policy is better. Remove returns the item removed, set
always returns void, etc. etc.

Brad




Archive powered by MHonArc 2.6.24.

Top of Page