Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XPath Namespace Nodes rethink

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XPath Namespace Nodes rethink
  • Date: Sun, 23 Jan 2005 12:11:44 -0600

Elliotte Harold writes:

> Elliotte Harold wrote:
>
> > My suspicion is that the proposed XPathNamespaceNode is *not* a subclass
> > of nu.xom.Node. A lot of code would need to be reconsidered if I were to
> > add an additional base node type.
>
> There's a problem with this. The Nodes object returned by query can't
> contain a non-Node (or rather it can, but the call to get() for that
> node would throw a ClassCastException). Options
>
> 1. Just make XPathNamespaceNode a subclass of Node.
> 2. Wrap the namespace node in something that can be returned, like an
> Element in a particular namespace.
> 3. Just make the query method return a List instead of a Nodes
> 4. Add an additional query method, probably in a separate package, that
> does return a List.
>
> I don't like any of these solutions. 2 and 4, however, seem the least ugly.

What's the problem with #1? If you offer no public constructors or
setters, and don't allow it to be detached what current code would
need to be reconsidered?

Brad




Archive powered by MHonArc 2.6.24.

Top of Page