Instructions
XSLT Instructions
Reference for the XSLT instructions implemented by goxslt. Each instruction has its own page with attributes, a minimal example, and additional examples where helpful.
Templates
xsl:template— define a match or named templatexsl:apply-templates— select nodes and apply matching templatesxsl:call-template— invoke a named templatexsl:next-match— chain to the next matching templatexsl:apply-imports— apply imported template rulesxsl:with-param— pass a parameter to a template or function
Control flow
xsl:if— conditional executionxsl:choose— multi-branch conditional (withxsl:when/xsl:otherwise)xsl:for-each— iterate over a sequencexsl:for-each-group— group and iteratexsl:iterate— loop with accumulating parameters (withxsl:break,xsl:next-iteration,xsl:on-completion)xsl:try— catch dynamic errors (withxsl:catch)
Variables and parameters
xsl:variable— bind a variablexsl:param— declare a parameter
Result tree construction
xsl:value-of— write a string valuexsl:text— write literal textxsl:sequence— add items to the resultxsl:copy— shallow copy of the current nodexsl:copy-of— deep copyxsl:element— create an element with computed namexsl:attribute— create an attributexsl:comment— create a comment nodexsl:processing-instruction— create a processing instructionxsl:namespace— create a namespace node
Sorting and grouping
xsl:sort— sort criterion forfor-each/apply-templates/perform-sortxsl:perform-sort— sort a sequence
Strings and numbers
xsl:analyze-string— split a string by a regular expressionxsl:number— generate formatted numbers
Output
xsl:result-document— write to a secondary output
Maps
xsl:map— construct an XPath map (withxsl:map-entry)
Stylesheet structure
xsl:function— define a custom XPath functionxsl:key— declare an index forkey()lookupxsl:package— package as root elementxsl:message— emit a diagnostic messagexsl:fallback— fallback for unknown instructions