Part 2 of Step Patterns: Node Tests

The second part of a step pattern is made up of node tests. You can use names of nodes as node tests, or the wild card * to select element nodes as well as node types. For example, the expression child::*/child::NAME selects all <NAME> elements that are grandchildren of the context node.

In addition to node names and the wild card character, you also can use the following node tests:

  • The comment() node test selects comment nodes.

  • The node() node test selects any type of node.

  • The processing-instruction() node test selects a processing instruction node. You can specify the name of the processing instruction to select in the parentheses.

  • The text() node test selects a text node.

The following sections examine these ...

Get Inside XSLT now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.