XML technologies / XPath / XPath 2.0: language reference / Path expressions: location steps / Node name test: NameTest

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, chapter 4.)

Every axis has a principal node kind (principal node kind). For most axes, this is the element node. Only the attribute axis has attribute nodes as its principal kind; the namespace axis similarly has namespace nodes.

Any node test consisting of a QName is called a NameTest. It always refers to the axis’s principal node kind, already determined by the chosen axis.

A NameTest succeeds when its expanded QName matches the node’s expanded name. The whole QName, or its namespace or local-name component, can be replaced by an asterisk wildcard *.

A NameTest can take the following forms:

Editorial note:
Binding namespace URIs to prefixes is explained in detail on this page. XPath expressions in XSLT always occur in an XML document, the stylesheet, whose namespace declarations provide prefix bindings. Other host languages may handle this differently because XPath leaves it unspecified. Source-document prefixes can therefore differ from those used in XPath expressions.

   

back to top