[jdom-interest] Problem with Element.getChildren()

Christophe D. Laprun chris.laprun at nist.gov
Tue Aug 15 07:56:26 PDT 2000

Hi all,

After deeper examination it seems that the problem is a problem of
namespace. I have define a default namespace for my elements. However,
calling getChildren(name) only returns the children without namespace.
This was my problem I guess. I don't find that very intuitive to have to
explicitely have to call getChildren with the namespace name when you
are using a default namespace. Maybe a method that returns elements from
the default namespace without having to explicetly specify it can be
handy ?



> "Christophe D. Laprun" wrote:
> >
> > Hi all,
> >
> > I have a problem with getChildren(String) on Element. I try to affect
> > the result of getChildren to a List (called "children" :) and then
> > process this List. However, it seems that isEmpty returns false on this
> > list even if it is not supposed to be (there are elements corresponding
> > to the String that I pass to getChildren in the document that I
> > process). After looking at the state of the objects with a debugger, it
> > seems that children has a size of 0 which is rather surprising. I looked
> > at PartialList.java and using the debugger, I verifed that the backing
> > list is not empty. I tried to override LinkedList.isEmpty on PartialList
> > to return backingList.isEmpty but it didn't change anything. I am not
> > familiar enough with the code to tell if it is a bug or if I am doing
> > something wrong. Can somebody help me on this ? I really would
> > appreciate it.
> >
> > Regards,
> >
> > Chris

Christophe Laprun    [Ingenieur ISIMA, France / Guest researcher @NIST]
web: http://www.nist.gov/speech/staff/laprunch.htm
email: chris.laprun at nist.gov
phone: (301) 975 3191             fax: (301) 670 0939
The universe seems neither benign nor hostile, merely indifferent -

More information about the jdom-interest mailing list