Attribute nodes
An attribute node represents an XML attribute.
An attribute node can have zero or one parent. The element node that owns an attribute is considered to be its parent, even though an attribute node is not a child of its parent element.
An attribute node has the following node properties:
- node name
- parent
- type name (The type name of an attribute node in Db2 is always xs:untypedAtomic.)
- string value
- typed value
For an attribute node, the string value is the normalized value of the attribute or schema normalized value of the attribute if the attribute was validated with a schema. The typed value is the same as the string value of type xs:untypedAtomic.
For example, suppose that a document has the following textual
representation:
<product xmlns="http://posample.org" pid="100-101-01">
<description>
<name>Snow Shovel, Deluxe 24"</name>
<details>A Deluxe Snow Shovel, 24 inches wide, ergonomic
curved handle with D-Grip</details>
<price>19.99</price>
<weight>2 kg</weight>
</description>
</product>
The
pid attribute has the following property values:
Node property | Value | Value type |
---|---|---|
node name | pid | |
parent | product node | |
type name | xs:untypedAtomic | |
string value | "100-101-01" | |
typed value | 100-101-01" | xs:untypedAtomic |