Skip to content

XSLT Elements

XSLT 3.0 Elements reference.

A

xsl:accept
Allows a package to restrict the visibility of components exposed by a package that it uses.

xsl:accumulator
An accumulator defines some processing that is to take place while a document is being sequentially processed: for example, a total that is to be accumulated.

xsl:accumulator-rule
Defines a rule for an xsl:accumulator

xsl:analyze-string
Applies a regular expression to a supplied string value.

xsl:apply-imports
Searches for a template that matches the current node and that is defined in a stylesheet that was imported (directly or indirectly) from the stylesheet containing the current template, and whose mode matches the current mode.

xsl:analyze-string
Applies a regular expression to a supplied string value.

xsl:apply-imports
Searches for a template that matches the current node and that is defined in a stylesheet that was imported (directly or indirectly) from the stylesheet containing the current template, and whose mode matches the current mode.

xsl:apply-templates
Causes navigation from the current element, usually but not necessarily to process its children. Each selected node is processed using the best-match xsl:template defined for that node.

xsl:assert
Used to make assertions in the form of XPath expressions, causing a dynamic error if the assertion turns out to be false.

xsl:attribute
The xsl:attribute element is used to add an attribute value to an xsl:element element or literal result element, or to an element created using xsl:copy.

xsl:attribute-set
Used to declare a named collection of attributes, which will often be used together to define an output style.

B

xsl:break
The xsl:break instruction is used within xsl:iterate, and causes premature completion before the entire input sequence has been processed.

C

xsl:call-template
Invokes a named template.

xsl:catch
In conjunction with xsl:try, the xsl:catch instruction allows recovery from dynamic errors.

xsl:character-map
Defines a named character map for use during serialization.

xsl:choose
Used to choose one of a number of alternative outputs.

xsl:comment
Indicates text that is to be output to the current output stream in the form of an XML or HTML comment.

xsl:context-item
Used to declare the initial context item for a template: whether the template requires a context item, and if so, what its expected type is.

xsl:copy
Causes the current XML node in the source document to be copied to the output.

xsl:copy-of
Copies the value obtained by evaluating the mandatory select attribute. It makes an exact copy.

D

xsl:decimal-format
Indicates a set of localisation parameters. If the xsl:decimal-format element has a name attribute, it identifies a named format; if not, it identifies the default format.

xsl:document
Creates a new document node.

E

xsl:element
Used to create an output element whose name might be calculated at run-time.

xsl:evaluate
Allows dynamic evaluation of XPath expressions constructed as a string.

xsl:expose
Used to modify the visibility of selected components within a package.

F

xsl:fallback
Used to define recovery action to be taken when an instruction element is used in the stylesheet and no implementation of that element is available.

xsl:for-each
Causes iteration over the nodes selected by a node-set expression.

xsl:for-each-group
Selects a sequence of nodes and/or atomic values and organizes them into subsets called groups.

xsl:fork
The result of the xsl:fork instruction is the sequence formed by concatenating the results of evaluating each of its contained instructions, in order.

xsl:function
Defines a function within a stylesheet. The function is written in XSLT but it may be called from any XPath expression in the stylesheet. It must have a non-default namespace prefix.

G

xsl:global-context-item
Used to declare whether a global context item is required, and if so, to declare its required type.

I

xsl:if
Used for conditional processing. It takes a mandatory test attribute, whose value is a boolean expression. The contents of the xsl:if element are expanded only of the expression is true.

xsl:import
Used to import the contents of one stylesheet module into another.

xsl:import-schema
Used to identify a schema containing definitions of types that are referred to in the stylesheet.

xsl:include
Used to include the contents of one stylesheet within another.

xsl:iterate
Used to iterate over a sequence, with the option to set parameters for use in the next iteration.

K

xsl:key
Used at the top level of the stylesheet to declare an attribute, or other value, that may be used as a key to identify nodes using the key() function within an expression.

M

xsl:map
Used to construct a new map.

xsl:map-entry
Used to construct a singleton map (one key and one value).

xsl:matching-substring
Used within an xsl:analyze-string element to indicate the default action to be taken with substrings that match a regular expression.

xsl:merge
The purpose of the instruction is to allow merging of two or more pre-sorted input files, optionally using streamed processing of any or all of the inputs.

xsl:merge-action
Used within an xsl:merge instruction to define the processing to be carried out on each group of input items sharing a value for the merge key.

xsl:merge-key
Used to define the merge keys on which the input sequences of a merging operation are sorted.

xsl:merge-source
Describes the input source for an xsl:merge instruction.

xsl:message
Causes a message to be displayed.

xsl:mode
Allows properties of a mode to be defined.

N

xsl:namespace
Creates a namespace node.

xsl:namespace-alias
A top-level element used to control the mapping between a namespace URI used in the stylesheet and the corresponding namespace URI used in the result document.

xsl:next-iteration
The xsl:next-iteration instruction occurs within xsl:iterate. The contents are a set of xsl:with-param elements defining the values of the iteration parameters to be used on the next iteration.

xsl:next-match
Chooses the next template to execute.

xsl:non-matching-substring
Used within an xsl:analyze-string element to indicate the default action to be taken with substrings that do not match a regular expression.

xsl:number
Outputs the sequential number of a node in the source document.

O

xsl:on-completion
Occurs within xsl:iterate to define processing to be carried out when the input sequence is exhausted.

xsl:on-empty
Used to allow conditional content construction to be made streamable. Outputs the enclosed content only if the containing sequence generates no "ordinary" content.

xsl:on-non-empty
Used to allow conditional content construction to be made streamable. Outputs the enclosed content only if the containing sequence also generates "ordinary" content.

xsl:otherwise
Used within an xsl:choose element to indicate the default action to be taken if none of the other choices matches.

xsl:output
Used to control the format of serial output files resulting from the transformation.

xsl:output-character
Used to define the output representation of a given Unicode character, in an xsl:character-map.

xsl:override
Allows a using package to override selected components from a used package.

P

xsl:package
Defines a set of stylesheet modules that can be compiled as a unit, independently of other packages.

xsl:param
Used to define a formal parameter to a template, the stylesheet, a function, or an iteration.

xsl:perform-sort
Takes a sequence as its input and produces a sorted sequence as its output.

xsl:preserve-space
Used at the top level of the stylesheet to define elements in the source document for which whitespace nodes are significant and should be retained.

xsl:processing-instruction
Causes an XML processing instruction to be output.

R

xsl:result-document
Used to direct output to a secondary output destination.

S

xsl:sequence
Used to construct arbitrary sequences. It may select any sequence of nodes and/or atomic values, and essentially adds these to the result sequence.

xsl:sort
Used within an xsl:for-each, xsl:apply-templates, xsl:for-each-group, or xsl:perform-sort to indicate the order in which the selected elements are processed.

xsl:source-document
Used to initiate streamed or unstreamed processing of a source document.

xsl:stream
Used to initiate streamed processing of a source document.

xsl:strip-space
Used at the top level of the stylesheet to define elements in the source document for which whitespace nodes are insignificant and should be removed from the tree before processing.

xsl:stylesheet
The xsl:stylesheet element is always the top-level element of an XSLT stylesheet. The name xsl:transform may be used as a synonym.

T

xsl:template
Defines a processing rule for source elements or other nodes of a particular type.

xsl:text
Causes its content to be output.

xsl:transform
The name xsl:transform is a synonym for xsl:stylesheet.

xsl:try
In conjunction with xsl:catch, the xsl:try instruction allows recovery from dynamic errors occurring within the expression it wraps.

U

xsl:use-package
Used to allow components of one package to be referenced within another.

V

xsl:value-of
Evaluates an expression as a string, and outputs its value to the current result tree.

xsl:variable
Used to declare a variable and give it a value.

W

xsl:when
Used within an xsl:choose element to indicate one of a number of choices.

xsl:where-populated
Used to allow conditional content construction to be made streamable. Used to avoid outputting a wrapper element if it would have no children.

xsl:with-param
Used to define an actual parameter to a template: within an xsl:call-template, xsl:apply-templates, xsl:apply-imports, or xsl:next-match element.

Comments