[jdom-interest] API instability?

Galluzzo, Eric EGalluzzo at synchrony.net
Tue Sep 5 06:57:08 PDT 2000


> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:elharo at metalab.unc.edu]
> 
> >When you say parent.getChild("child") it's kinda natural for the
> >unspecified namespace of "child" to be the same as the 
> parent, not the
> >no-namespace.  It's a simple way of thinking: ask Bob Jones about his
> >kid Billy and he naturally refers to the Billy in the Jones 
> namespace.
> >:-)
> >
> 
> Bugs or no bugs, this just doesn't seem obvious to me. I'd rather 
> explicitly specify my namespaces. I think this is going to cause big, 
> unexpected problems for programmers when they encounter documents 
> where the children don't have the same namespaces as the parent.

Well, I can't see how this is different from the current situation.  If a
child has a different namespace from its parent, its namespace must be
specified during getChild(), in both the current and the proposed new
implementation.  The only difference would be if you had an element in the
default namespace underneath one in some other namespace, which is fairly
rare.  In fact, the only place I've ever seen this is in an XSLT stylesheet.

In fact, the whole reason I proposed getChild() retrieve elements of the
same namespace by default is that that is the behavior I expected from that
method, and it seems to me to be a much more useful behavior.  I agree that
there are cases wherein one wishes to retrieve children in different
namespaces from their parents, but this is easily accomplished in the same
way that it currently is.  In addition, it is much more common (in my
experience) to want to retrieve children in the same namespace, and this
proposed change would make it considerably easier for this to happen.

    - Eric



More information about the jdom-interest mailing list