The Attribute Class

The Attribute class, shown in Example 15.10, represents an attribute of an element other than one that declares a namespace. Each attribute has these five basic properties:

Local Name

A String accessible through the setName() and getName() methods.

Namespace

A Namespace object that encapsulates both the namespace URI and the prefix. This is accessible through the setNamespace() and getNamespace() methods. For all unprefixed attributes, this is Namespace.NO_NAMESPACE. The prefix, URI, and fully qualified name are separately readable through the getNamespaceURI(), getNamespacePrefix(), and getQualifiedName() convenience methods.

Value

A String that contains the attribute's normalized value. This is accessible through the getValue() ...

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.