[jdom-interest] getChildren strange behaviour

Elliotte Harold elharo at metalab.unc.edu
Mon Sep 5 10:00:39 PDT 2005


Marco Ceci wrote:
> Hi, I'm trying to restrict my input with
> element.getChildren("subelement"); but without luck: getChildren without
> parameter get me a list of all the children element but if i use the
> element name (the same that in the previous test i can read using
> .getName()) in the .getChildren the function return me null. 

Your elements are in a namespace (defaulted from the DTD). You need to 
specify the namespace when asking for the children. getChildren(name) 
only returns elements in no namespace.


-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim


More information about the jdom-interest mailing list