#XSLT Instructions Reference
Every XSLT instruction is an XML element in the xsl: namespace that controls how the transformation proceeds. This reference covers all instructions supported by the PhoenixmlDb XSLT engine, organized by purpose.
#Instruction Categories
|
Category |
Instructions |
Description |
|---|---|---|
|
value-of, text, comment, processing-instruction, sequence, message |
Producing text, nodes, and diagnostic output |
|
|
if, choose/when/otherwise, switch, where-populated, on-empty, on-non-empty |
Conditional processing |
|
|
variable, param, with-param |
Declaring and passing values |
|
|
for-each, sort, perform-sort, iterate, break, next-iteration |
Looping and ordering |
|
|
for-each-group |
Four grouping modes with current-group() and current-grouping-key() |
|
|
copy, copy-of, mode on-no-match |
Copying nodes and the identity transform pattern |
|
|
element, attribute, namespace, document |
Building nodes with dynamic names |
|
|
result-document, output |
Generating multiple files and controlling serialization |
|
|
function |
Defining reusable functions callable from XPath |
|
|
key |
Indexing documents for fast lookup |
|
|
analyze-string, matching-substring, non-matching-substring |
Regex-based string processing |
|
|
try, catch, assert, fallback |
Handling errors and asserting conditions |
|
|
merge, merge-source, merge-key, merge-action |
Combining sorted input sources |
|
|
map, map-entry, array, array-member, for-each-member, record |
Constructing structured data (XSLT 3.0/4.0) |
|
|
source-document, accumulator, accumulator-rule, fork |
Processing large documents efficiently |
|
|
use-package, accept, override, expose |
Reusable stylesheet libraries with visibility control |
|
|
evaluate |
Runtime XPath evaluation |
|
|
number, decimal-format, character-map |
Numbering schemes and format customization |
#Quick Reference
Every instruction follows this pattern:
<xsl:instruction-name attribute="value">
<!-- content (other instructions or literal output) -->
</xsl:instruction-name>Instructions can appear in two places:
-
Top-level declarations (children of
xsl:stylesheet) —xsl:template,xsl:variable,xsl:function,xsl:key,xsl:output, etc. -
Sequence constructors (inside templates and functions) —
xsl:value-of,xsl:for-each,xsl:if, etc.
Some instructions (like xsl:variable and xsl:param) can appear in both positions with slightly different semantics.