Difference between * and node() in XSLT

<xsl:template match="node()">

is an abbreviation for:

<xsl:template match="child::node()">

This matches any node type that can be selected via the child:: axis:

  • element

  • text-node

  • processing-instruction (PI) node

  • comment node.

On the other side:

<xsl:template match="*">

is an abbreviation for:

<xsl:template match="child::*">

This matches any element.

The XPath expression: someAxis::* matches any node of the primary node-type for the given axis.

For the child:: axis the primary node-type is element.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)