- 104 -
Alex
Figure 4.6:
Tree model of Text example.
Attr (Attribute).
The Attr node type represents the attributes that are declared within the
scope of an element (see Figure 4.7). Attribute nodes can also be children of nodes other
than Element nodes, such as Entity and Notation nodes. The following XML document
produces an Element node for root and an Attribute node for myAttribute. The
myAttribute Attribute node is a child of the root Element node. A NamedNodeMap
collection is used instead of the NodeList collection to hold attributes. Also, a Text node
representing someValue is exposed.