XML technologies / XSLT / Introduction to XSLT 2.0 / XSLT and XPath – getting started / String values and attribute values / Path expressions for attribute nodes

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 1.)

Attribute nodes are not on the tree’s normally traversed element axes, and are therefore not shown in the tree. An axis name is mandatory when selecting an attribute.

The full axis name attribute can always be used as shown above, but is essentially redundant and therefore uncommon.

Summary: string values and attribute values

  • An element node’s string value consists of all text nodes contained directly or indirectly in that element, concatenated in document order.

  • Attribute order has no meaning and is therefore irrelevant. Attributes are considered unordered, like the fields of a record in a database table.

  • For a location step targeting an attribute, abbreviation @ is used as the axis name before the attribute name. Like any path expression, it must be interpreted in context.

  • An attribute node’s string value is the character string making up its attribute value.

   

back to top