JDOM Children Elements and Namespaces

  • Thread starter gimme_this_gimme_that
  • Start date
G

gimme_this_gimme_that

Why is it that this works :

root.getChild("detail",NS).getChild("site-export").getChild("category-list").addContent((Content)c);


But this does not :

Element detail = root.getChild("detail",NS);
detail.getChild("category-list").addContent((Content)c);
// There are no namespace prefixes for elements below detail.

In other words it looks like to get children Elements
when using Namespaces I have to navigate all the way down
to the specific node instead of having JDOM find the nearest
node having the name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top