NodeType

Restrict the type of a node in a NodeTest.


Syntax

NodeType

graphics/NodeType.jpg

Description

A NodeType is used in a NodeTest and restrict the node-set to the specified type of node. See the description to NodeTest for more details.

Compatibility

It corresponds to the expression NodeType defined in XPath, Section 3.7, Rule 38 with the exception that the XPath definition also includes a named processing instruction which in X-Query is subsumed in the definition of NodeTest. However, this difference is of no practical relevance.

Examples

  • Select all comment nodes:

    //comment()
  • Retrieve all children of the context node:

    node()

Related Expression

Step