Navigating JDOM Trees
Once you've parsed a document and formed a Document object, you'll probably want to search it to select the parts of it your program is interested in. In JDOM, most navigation takes place through the methods of the Element class. The complete children of each Element are available as a java.util.List returned by the getContent() method. Only the child elements of each Element are available as a java.util.List returned by the getChildren() method.[2]
[2] Yes, the terminology is a little confusing here. This is a case in which JDOM is marching out of step with the rest of the XML world. JDOM uses the word children to refer only to child elements.
Because JDOM uses the Java Collections API to manage the tree, it is simultaneously ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access