Most attribute work can be done through the
Element
class.
Each attribute is represented as an Attribute
object
Each Attribute
has:
A local name, a String
A value, a String
A Namespace
object (which may be
Namespace.NO_NAMESPACE
)
A parent Element
object (which may be
null
)
A type
code such as
Attribute.CDATA_ATTRIBUTE
,
Attribute.ID_ATTRIBUTE
, or Attribute.UNDECLARED_ATTRIBUTE
)
JDOM enforces restrictions on attribute names and values; e.g. name may not contain white space
Attributes are stored in a java.util.List
in the Element
that contains them
This list only contains Attribute
objects.