Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] getChildren strange behaviour

Elliotte Rusty Harold

2005-09-05

Replies:

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@(protected)
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
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.