Skip to content


Chooses the next template to execute.

Available in XSLT 2.0 and later versions. Available in all Saxon editions.

  • Category: instruction
  • Content: ( xsl:with-param | xsl:fallback )*
  • Permitted parent elements: any XSLT element whose content model is sequence-constructor; any literal result element
  • Element has no attributes


The xsl:next-match instruction was introduced in XSLT 2.0. It is very similar to xsl:apply-imports, but with a different algorithm for choosing the next template to execute. It chooses the template rule that matches the current node and that would have been chosen if the current template rule and all higher precedence/priority rules were not there.

In practice xsl:next-match is nearly always preferable to xsl:apply-imports since the rules for using it are much more flexible and more intuitive.

See also