The Element Class

The structure of an XML document is based on its elements, so it should come as no surprise that the Element class is one of the larger and more important classes in JDOM. Because JDOM has no generic Node class or interface, the Element class is the primary means by which a program navigates the tree to find particular content.

Each Element object has the following seven basic properties:

Local Name

A String that is initialized when the Element is constructed, and which can never be null or the empty string. It is accessible through the setName() and getName() methods:

public Element setName (String name) throws IllegalNameException 
public String getName()

Namespace

A Namespace object that encapsulates both the namespace URI and ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.