A component of the context that has no value is said to be absent.
An operand usage of absorption indicates that the construct reads the subtree(s) rooted at a supplied node(s).
An
accumulator defines a series of
values associated with the nodes of the tree. If an accumulator is
applicable to a particular tree, then for each node in the tree, other than
attribute and namespace nodes, there will be two values available, called the
pre-descent and post-descent values. These two values are available via a pair of
functions, accumulator-before
and
accumulator-after
.
The functions
accumulator-before
and
accumulator-after
are referred to as the
accumulator functions.
A stylesheet can use the
xsl:namespace-alias
element to declare that a literal namespace URI is being used
as an alias for a target
namespace URI.
A template rule is applicable to one or more modes.
The modes to which it is applicable are defined by the mode
attribute of the xsl:template
element. If the attribute is
omitted, then the template rule is applicable to the default mode specified in the [xsl:]default-mode
attribute of the innermost containing
element that has such an attribute, which in turn defaults to
the unnamed mode. If the
mode
attribute is present, then its value
must be a non-empty whitespace-separated list of tokens,
each of which defines a mode to which the template rule is
applicable.
The arity of a stylesheet
function is the number of xsl:param
elements in the function
definition.
The term atomization is defined in Section 2.4.2 Atomization XP30. It is a process that takes as input a sequence of items, and returns a sequence of atomic values, in which the nodes are replaced by their typed values as defined in [XDM 3.0]. If the XPath 3.1 Feature is implemented, then arrays (see 27.7.1 Arrays) are atomized by atomizing their members, recursively.
An attribute set is
defined as a set of xsl:attribute-set
declarations in the same
package that share the same expanded QName.
An
attribute set invocation is a pseudo-instruction
corresponding to a single EQName appearing within an
[xsl:]use-attribute-sets
attribute; the effect of the
pseudo-instruction is to cause the referenced attribute set to be evaluated.
In an
attribute that is designated as an attribute value template, such
as an attribute of a literal result
element, an expression can
be used by surrounding the expression with curly brackets ({}
),
following the general rules for value
templates
An element is processed with backwards compatible behavior if its
effective version is less than
3.0
.
The base output URI is a URI to be used as the base URI when resolving a relative URI reference allocated to a final result tree. If the transformation generates more than one final result tree, then typically each one will be allocated a URI relative to this base URI.
A basic XSLT processor is an XSLT processor that implements all the mandatory requirements of this specification with the exception of constructs explicitly associated with an optional feature.
A character map allows a specific character appearing in a text or attribute node in the final result tree to be substituted by a specified string of characters during serialization.
For some construct
kinds, one or more operand roles may be defined to form a choice operand
group. This concept is used where it is known that operands are mutually exclusive (for example the
then
and else
clauses in a conditional
expression).
A circularity is said to exist if a construct such as a global variable, an attribute set, or a key, is defined in terms of itself. For example, if the expression or sequence constructor specifying the value of a global variable X references a global variable Y, then the value for Y must be computed before the value of X. A circularity exists if it is impossible to do this for all global variable definitions.
Climbing: indicates that streamed nodes returned by the construct are reached by navigating the parent, ancestor[-or-self], attribute, and/or namespace axes from the node at the current streaming position.
Facilities in XSLT 3.0 and XPath 3.0 that require strings to be ordered rely on the concept of a named collation. A collation is a set of rules that determine whether two strings are equal, and if not, which of them is to be sorted before the other.
The combined posture of a choice operand group is determined by the postures of the operands in the group (the operand postures), and is the first of the following that applies:
If any of the operand postures is roaming, then the combined posture is roaming.
If all of the operand postures are grounded, then the combined posture is grounded.
If one or more of the operand postures is climbing and the remainder (if any) are grounded, then the combined posture is climbing.
If one or more of the operand postures is striding and the remainder (if any) are grounded, then the combined posture is striding.
If one or more of the operand postures is crawling and each of the remainder (if any) is either striding or grounded, then the combined posture is crawling.
Otherwise (for example, if the group includes both an operand with climbing posture and one with crawling posture), the combined posture is roaming.
The signatures of two components are compatible if they present the same interface to the user of the component. The additional rules depend on the kind of component.
The term component is used to refer to any of the following: a stylesheet function, a named template, a mode, an accumulator, an attribute set, a key, global variable, or a mode.
The ordered collection of merge key values computed for one item in a merge input sequence (one for each merge key component within the merge key specification) is referred to as a composite merge key value.
The term construct refers to the union of the following: a sequence constructor, an instruction, an attribute set, a value template, an expression, or a pattern.
A consuming construct is any construct deemed consuming by the rules in this section (19 Streamability).
A
component declaration results in multiple components, one in the package in
which the declaration appears, and potentially one in each package that uses
the declaring package, directly or indirectly, subject to the visibility of the
component. Each of these multiple components has the same declaring package, but each has a different containing
package. For the original component, the declaring package and the
containing package are the same; for a copy of a component made as a result of
an xsl:use-package
declaration, the declaring package will be
the original package, and the containing package will be the package in which
the xsl:use-package
declaration appears.
The context
item is the item currently being processed. An item (see
[XDM 3.0]) is either an atomic value (such
as an integer, date, or string), a node, or
a function item. It changes whenever instructions such as
xsl:apply-templates
and
xsl:for-each
are used to process a sequence of
items; each item in such a sequence becomes the context item while
that item is being processed.
For every expression, it is possible to establish by static analysis, information about the item type of the context item for evaluation of that expression. This is called the context item type of the expression.
If the context item is a node (as distinct from an atomic value such as an integer), then it is also referred to as the context node. The context node is not an independent variable, it changes whenever the context item changes. When the context item is an atomic value or a function item, there is no context node.
The
context position is the position of the context item
within the sequence of items currently being processed. It changes
whenever the context item changes. When an instruction such as
xsl:apply-templates
or
xsl:for-each
is used to process a sequence of
items, the first item in the sequence is processed with a context
position of 1, the second item with a context position of 2, and so
on.
The context posture. This captures information about how the context item used as input to the construct is positioned relative to the streamed input. The context posture of a construct C is the posture of the expression whose value sets the focus for the evaluation of C.
The context
size is the number of items in the sequence of items
currently being processed. It changes whenever instructions such as
xsl:apply-templates
and
xsl:for-each
are used to process a sequence of
items; during the processing of each one of those items, the context
size is set to the count of the number of items in the sequence (or
equivalently, the position of the last item in the
sequence).
Within a focus-changing construct there are one or more operands that are evaluated with a focus determined by the controlling operand
(or in some cases such as
xsl:on-completion
, with an absent
focus); these are referred to as
controlled operands.
Within a focus-changing construct there is in many cases one operand whose value determines the focus for evaluating other operands; this is referred to as the controlling operand.
Crawling: typically indicates that streamed nodes returned by a construct are reached by navigating the descendant[-or-self] axis.
While
the xsl:matching-substring
instruction is active, a set of
current captured substrings is available, corresponding to the
parenthesized subexpressions of the regular expression.
The current group is the group itself, as a sequence of items
The current grouping key is a single atomic value, or in the case of a composite key, a sequence of atomic values, containing the grouping key of the items in the current group.
The
current merge group is a map. During
evaluation of an xsl:merge
instruction, as each group of
items with equal composite merge
key values is processed, the current merge group is set to a
map whose keys are the names of the various merge sources, and whose
associated values are the items from each merge source having the relevant
composite merge key value.
The current
merge key is a sequence of atomic values. During evaluation of an
xsl:merge
instruction, as each group of items with equal
composite merge key
values is processed, the current merge key is set to the
composite merge key value that these items have in common.
At any point in the processing
of a stylesheet, there is a current mode. When the transformation
is initiated, the current mode is the initial mode, as described in 2.3 Initiating a Transformation. Whenever an xsl:apply-templates
instruction is evaluated, the current mode becomes the mode selected by this
instruction.
The current output URI is the URI associated with the principal result or secondary result that is currently being written.
At any point in
the processing of a stylesheet, there may
be a current template rule. Whenever a template rule is chosen as a result of
evaluating xsl:apply-templates
,
xsl:apply-imports
, or xsl:next-match
, the
template rule becomes the current template rule for the evaluation of the rule’s
sequence constructor.
All the
xsl:decimal-format
declarations in a package that share the same name are grouped into a named
decimal format; those that have no name are grouped into a single
unnamed decimal format.
Top-level elements fall into two categories: declarations, and user-defined data elements. Top-level elements whose names are in the XSLT namespace are declarations. Top-level elements in any other namespace are user-defined data elements (see 3.7.3 User-defined Data Elements)
The declarations within a stylesheet level have a total ordering
known as declaration order. The order of declarations within a
stylesheet level is the same as the document order that would result if each
stylesheet module were inserted textually in place of the
xsl:include
element that references it.
The above constructs (template rules belonging to a
mode declared with streamable="yes"
; and xsl:source-document
,
xsl:attribute-set
, xsl:function
,
xsl:merge-source
, and xsl:accumulator
elements specifying
streamable="yes"
) are said to be
declared-streamable.
The declaring
package of a component is the
package that contains the declaration (or,
in the case of xsl:attribute-set
and
xsl:key
, multiple declarations) of the
component.
In this
specification the term default collation means the collation
that is used by XPath operators such as eq
and
lt
appearing in XPath expressions within the
stylesheet.
If no priority
attribute is specified on an xsl:template
element, a
default priority is computed, based on the syntax of the pattern supplied in the match
attribute.
A string in the form of a lexical QName may occur as the value of an attribute node in a stylesheet module, or within an XPath expression contained in an attribute or text node within a stylesheet module, or as the result of evaluating an XPath expression contained in such a node. The element containing this attribute or text node is referred to as the defining element of the lexical QName.
Some constructs defined in this specification are described as being deprecated. The use of this term implies that stylesheet authors should not use the construct, and that the construct may be removed in a later version of this specification.
An error that is not capable of detection until a source document is being transformed is referred to as a dynamic error.
A
processor that claims conformance with the dynamic evaluation feature
must evaluate the xsl:evaluate
function as
described in this specification.
The result of evaluating a value template is referred to as its effective value.
The effective
version of an element in a stylesheet module or package manifest is the decimal value of the [xsl:]version
attribute
(see 3.4 Standard Attributes) on that element or on the innermost
ancestor element that has such an attribute, excluding the version
attribute on an xsl:output
element.
A stylesheet module whose outermost element is the child of a non-XSLT element in a host document is referred to as an embedded stylesheet module. See 3.12 Embedded Stylesheet Modules.
An EQName is a string representing an expanded QName where the string, after removing leading and trailing whitespace, is in the form defined by the EQNameXP30 production in the XPath specification.
An expanded
QName is a value in the value space of the xs:QName
datatype as defined in the XDM data model (see [XDM 3.0]): that is, a triple containing namespace prefix (optional), namespace URI
(optional), and local name. Two expanded QNames are equal if the namespace URIs
are the same (or both absent) and the local names are the same. The prefix
plays no part in the comparison, but is used only if the expanded QName needs
to be converted back to a string.
An explicit
default for a parameter is indicated by the presence of either a
select
attribute or a non-empty sequence
constructor.
A parameter is
explicitly mandatory if it is a function parameter, or if the
required
attribute is present and has the value
yes
.
Within this specification, the term XPath expression, or simply expression, means a string that matches the production ExprXP30 defined in [XPath 3.0], with the extensions defined in 21 Maps.
An element from the XSLT namespace may have any attribute not from the XSLT namespace, provided that the expanded QName (see [XPath 3.0]) of the attribute has a non-null namespace URI. These attributes are referred to as extension attributes.
An extension function is a named function introduced to the static or dynamic context by mechanisms outside the scope of this specification.
An extension instruction is an element within a sequence constructor that is in a namespace (not the XSLT namespace) designated as an extension namespace.
The extension instruction mechanism allows namespaces to be designated as extension namespaces. When a namespace is designated as an extension namespace and an element with a name from that namespace occurs in a sequence constructor, then the element is treated as an instruction rather than as a literal result element.
The first of the two output states is called final output state. This state applies when instructions are writing to a final result tree.
A final result tree is a result tree that forms part of the output of a transformation: specifically, a tree built by post-processing the items in the principal result or in a secondary result. Once created, the contents of a final result tree are not accessible within the stylesheet itself.
When a sequence constructor is evaluated, the processor keeps track of which items are being processed by means of a set of implicit variables referred to collectively as the focus.
A focus-changing construct is a construct that has one or more operands that are evaluated with a different focus from the parent construct.
The
focus-setting container of a construct C is the
innermost focus-changing construct
F (if one exists) such that C is directly or
indirectly contained in a controlled operand of
F. If there is no such construct
F, then the focus-setting container is the containing
declaration, for example an
xsl:function
or xsl:template
element.
An
element is processed with forwards compatible behavior if its
effective version is greater than
3.0
.
A free-ranging construct is any construct deemed free-ranging by the rules in this section (19 Streamability).
When used in this specification without further qualification, the term function conversion rules means the function conversion rules defined in [XPath 3.0], applied with XPath 1.0 compatibility mode set to false.
An
xsl:param
element may appear as a child of an
xsl:function
element, before any
non-xsl:param
children of that element. Such a parameter
is known as a function parameter. A function parameter is a
local variable with the
additional property that its value can be set when the function is called,
using a function call in an XPath expression.
There are 28
fundamental item types: the 7 node kinds defined in [XDM 3.0] (element, attribute, etc.), the 19 primitive atomic
types defined in [XML Schema Part 2], plus the types
function(*)
and xs:untypedAtomic
. The fundamental
item types are disjoint, and every item is an instance of exactly one of
them.
Many constructs share the same streamability rules. These rules, referred to as the general streamability rules, are defined here.
An item that acts as the global
context item for the transformation. This item acts
as the context item when evaluating
the
select
expression or sequence constructor of a
global variable declaration
within the top-level package, as described in 5.3.3.1 Maintaining Position: the Focus. The global context item may also be available in a named template
when the stylesheet is invoked as described in 2.3.4 Call-Template Invocation
A top-level variable-binding element declares a global variable that is visible everywhere (except within its own declaration, and where it is shadowed by another binding).
Grounded: indicates that the value returned by the construct does not contain nodes from the streamed input document
The xsl:for-each-group
instruction allocates the items in an input sequence into groups of
items (that is, it establishes a collection of sequences) based either on common
values of a grouping key, or on a pattern that
the initial or final item in a group must
match.
If either of the
group-by
or group-adjacent
attributes is present,
then for each item in the population a set
of grouping keys is calculated, as follows: the expression contained
in the group-by
or group-adjacent
attribute is
evaluated; the result is atomized; and any xs:untypedAtomic
values
are cast to xs:string
. If
composite="yes"
is specified, there is a single grouping key
whose value is the resulting sequence; otherwise, there is a set of grouping
keys, consisting of the distinct atomic values present in the result
sequence.
A guaranteed-streamable construct is a construct that is declared to be streamable and that follows the particular rules for that construct to make streaming possible, as defined by the analysis in this specification.
The higher-order functions feature contains functionality connected with the use of functions as items in the data model, that can be stored in variables and passed to other functions.
Whether or not the operand is higher-order. For this purpose an operand O of a construct C is higher-order if the semantics of C potentially require O to be evaluated more than once during a single evaluation of C.
Two components are said to be homonymous if they have the same symbolic identifier.
Types S and T are considered identical for the purpose of
these rules if and only if subtype(S, T)
and subtype(T,
S)
both hold, where the subtype relation is defined in Section
2.5.6.1 The judgement subtype(A, B)
XP30.
The result of evaluating a sequence constructor is the sequence of items formed by concatenating the results of evaluating each of the nodes in the sequence constructor, retaining order. This is referred to as the immediate result of the sequence constructor.
A specific product that performs the functions of an XSLT processor is referred to as an implementation.
In this specification, the term implementation-defined refers to a feature where the implementation is allowed some flexibility, and where the choices made by the implementation must be described in documentation that accompanies any conformance claim.
The term implementation-dependent refers to a feature where the behavior may vary from one implementation to another, and where the vendor is not expected to provide a full specification of the behavior.
If a parameter that is
not explicitly mandatory has no explicit default value, then it has an implicit
default value, which is the empty sequence if there is an
as
attribute, or a zero-length string if not.
If a parameter
has an implicit default value which cannot be converted to
the required type (that is, if it has an as
attribute which does not permit the empty sequence), then the parameter is
implicitly mandatory.
A declaration D in the stylesheet is defined to have lower import precedence than another declaration E if the stylesheet level containing D would be visited before the stylesheet level containing E in a post-order traversal of the import tree (that is, a traversal of the import tree in which a stylesheet level is visited after its children). Two declarations within the same stylesheet level have the same import precedence.
The stylesheet levels making up a stylesheet are treated as forming an
import tree. In the import tree, each stylesheet level has one
child for each xsl:import
declaration that it
contains.
The schema components that may be referenced by name in a package are referred to as the in-scope schema components.
A stylesheet may be evaluated by calling a named stylesheet function, referred to as the initial function.
For each group, the item within the group that is first in population order is known as the initial item of the group.
A stylesheet may be evaluated by supplying a
value to be processed, together with an initial mode. The
value (which can be any sequence of items) is referred to as the initial
match selection. The processing then corresponds to the effect of the
xsl:apply-templates
instruction.
The initial mode is the mode used to select template rules for processing items in the initial match selection when apply-templates invocation is used to initiate a transformation.
A stylesheet may be evaluated by selecting a named template to be evaluated; this is referred to as the initial named template.
The sequence to be sorted is referred to as the initial sequence.
The initial setting of a component of the dynamic context is used
when evaluating global variables
and stylesheet parameters,
when evaluating the use
and match
attributes of
xsl:key
, and when evaluating the initial-value
of
xsl:accumulator
and the select
expressions or
contained sequence constructors of
xsl:accumulator-rule
An operand usage of inspection indicates that the construct accesses properties of a supplied node that are available without reading its subtree.
An instruction is either an XSLT instruction or an extension instruction.
The following constructs are classified as invocation constructs: the
instructions xsl:call-template
,
xsl:apply-templates
, xsl:apply-imports
, and
xsl:next-match
; XPath function calls that bind to stylesheet functions; XPath dynamic
function calls; the functions accumulator-before
and
accumulator-after
; the [xsl:]use-attribute-sets
attribute. These all have the characteristic that they can cause evaluation of
constructs that are not lexically contained within the calling
construct.
A key is defined as a set of
xsl:key
declarations in the same
package that share the same
name.
The expression in the
use
attribute and the sequence constructor within an xsl:key
declaration are referred to collectively as the key specifier. The
key specifier determines the values that may be used to find a node using this
key.
A lexical QName
is a string representing an expanded
QName where the string, after removing leading and trailing
whitespace, is within the lexical space of the xs:QName
datatype
as defined in XML Schema (see [XML Schema Part 2]): that is, a local
name optionally preceded by a namespace prefix and a colon.
Every package within a stylesheet, other than the top-level package, is referred to as a library package.
A namespace URI in the stylesheet tree that is being used to specify a namespace URI in the result tree is called a literal namespace URI.
In a sequence constructor, an element in the stylesheet that does not belong to the XSLT namespace and that is not an extension instruction (see 24.2 Extension Instructions) is classified as a literal result element.
As well as being allowed as a
declaration, the
xsl:variable
element is also allowed in sequence constructors. Such a variable
is known as a local variable.
A map consists of a set of entries. Each entry comprises a key which is an arbitrary atomic value, and an arbitrary sequence called the associated value.
The match type of a pattern is the most specific U-type that is known to match all items that the pattern can match.
A merge
activation is a single evaluation of the sequence constructor contained
within the xsl:merge-action
element, which occurs once for each
distinct composite merge key
value.
A merge input sequence is an arbitrary sequenceDM30 of items which is already sorted according to the merge key specification for the corresponding merge source definition.
A merge key
component specifies one component of a merge key specification; it
corresponds to a single xsl:merge-key
element in the
stylesheet.
A merge
key specification consists of one or more adjacent
xsl:merge-key
elements which together define how the merge input sequences selected by a
merge source definition are
sorted. Each xsl:merge-key
element defines one merge key component.
For each item in a merge input sequence, a value is computed for each merge key component within the merge key specification. The value computed for an item by using the Nth merge key component is referred to as the Nth merge key value of that item.
A merge source definition is the definition of one kind of input to the merge operation. It selects zero or more merge input sequences, and it includes a merge key specification to define how the merge key values are computed for each such merge input sequence.
A mode is a set of template rules;
when the xsl:apply-templates
instruction selects a set of items
for processing, it identifies the rules to be used for processing those items by
nominating a mode, explicitly or implicitly.
All the
xsl:mode
declarations in a package that share the same
name are grouped into a named mode definition; those that have no
name are grouped into a single unnamed mode definition.
A motionless construct is any construct deemed motionless by the rules in this section (19 Streamability).
Templates can be invoked by
name. An xsl:template
element with a name
attribute
defines a named template.
The rules for the individual XSLT instructions that construct a result tree (see 11 Creating Nodes and Sequences) prescribe some of the situations in which namespace nodes are written to the tree. These rules, however, are not sufficient to ensure that the prescribed constraints are always satisfied. The XSLT processor must therefore add additional namespace nodes to satisfy these constraints. This process is referred to as namespace fixup.
An operand usage of navigation indicates that the construct may navigate freely from the supplied node to other nodes in the same tree, in a way that is not constrained by the streamability rules.
The term non-contextual function
call is used to refer to function calls that do not pass the dynamic
context to the called function. This includes all calls on stylesheet functions and all
dynamic function
invocationsXP30, (that is calls to function items as permitted by
XPath 3.0). It excludes calls to some
functions in the namespace
http://www.w3.org/2005/xpath-functions
, in
particular those that explicitly depend on the context, such as the
current-group
and regex-group
functions. It is implementation-defined whether, and under what circumstances,
calls to extension functions are
non-contextual.
A predicate is a non-positional predicate if it satisfies both of the following conditions:
The predicate does not contain a function call or named function reference to any of the following functions, unless that call or reference occurs within a nested predicate:
position
FO30
last
FO30
function-lookup
FO30.
Note:
The exception for nested predicates is there to ensure that patterns
such as match="p[@code = $status[last()]]
are not disqualified.
The expression immediately contained in the predicate is a non-numeric expression. An expression is non-numeric if the intersection of its static type (see 19.1 Determining the Static Type of a Construct) with U{xs:decimal, xs:double, xs:float} is U{}.
A non-schema-aware processor is a processor that does not claim conformance with the schema-aware conformance feature. Such a processor must handle constructs associated with schema-aware processing as described in this section.
In an actual instance of a construct, there will be a number of operands. Each operand is itself a construct; the construct tree can be defined as the transitive relation between constructs and their operands.
For every construct kind, there is a set of zero or more operand roles.
The operand usage. This gives information, in the case where the operand value contains nodes, about how those nodes are used. The operand usage takes one of the values absorption, inspection, transmission, or navigation.
Functions that take an options parameter adopt common conventions on how the options are used. These are referred to as the option parameter conventions. These rules apply only to functions that explicitly refer to them.
There is a total ordering among groups referred to as the order of first appearance. A
group G is defined to precede a group H in order of first
appearance if the initial item of
G precedes the initial item of H in population order. If
two groups G and H have the same initial item (because the
item is in both groups) then G precedes H if the grouping key of G precedes the
grouping key of H in the sequence that results from evaluating the
group-by
expression of this initial item.
All the
xsl:output
declarations within a
package that share the same name
are grouped into a named output definition; those that have no name are
grouped into a single unnamed output definition.
Each instruction in the stylesheet is evaluated in one of two possible output states: final output state or temporary output state
A component in a using package may
override a component in a used package, provided that the
visibility of the component in the
used package is either abstract
or public
. The
overriding declaration is written as a child of the
xsl:override
element, which in turn appears as a child
of xsl:use-package
.
An explicit package is
represented by an xsl:package
element, which will generally be
the outermost element of an XML document. When the
xsl:package
element is not used explicitly, the entire
stylesheet comprises a single implicit package.
The content of the
xsl:package
element is referred to as the package
manifest
The xsl:param
element
declares a parameter, which may be a stylesheet parameter, a template parameter, a function parameter, or an xsl:iterate
parameter. A parameter is a
variable with the additional property that
its value can be set by the caller.
A pattern specifies a set of conditions on an item. An item that satisfies the conditions matches the pattern; an item that does not satisfy the conditions does not match the pattern.
The picture string
is the string supplied as the second argument of the
format-number
FO30 function.
The xsl:number
instruction performs two tasks: firstly, determining a place marker
(this is a sequence of integers, to allow for hierarchic numbering schemes such as
1.12.2
or 3(c)ii
), and secondly, formatting the place
marker for output as a text node in the result sequence.
The sequence of items to be grouped,
which is referred to as the population, is determined by evaluating
the XPath expression contained in the
select
attribute.
The population is treated as a sequence; the order of items in this sequence is referred to as population order
The integer literals and the optional
NamePart
within the version number are referred to as the
portions of the version number.
The posture of the expression. This captures information about the way in which the streamed input document is positioned on return from evaluating the construct. The posture takes one of the values climbing, striding, crawling, roaming, or grounded.
An operand is potentially consuming if at least one of the following conditions applies:
The operand usage is transmission and the operand is not grounded.
A predicate pattern is written as
.
(dot) followed by zero or more predicates in square
brackets, and it matches any item for which each of the predicates evaluates
to true
.
A principal result: this can be any sequence of items (as defined in [XDM 3.0]).
Within a package, one stylesheet module functions as the
principal stylesheet module. The complete package is assembled by
finding the stylesheet modules referenced directly or indirectly from the
principal stylesheet module using xsl:include
and
xsl:import
elements: see 3.11.2 Stylesheet Inclusion and 3.11.3 Stylesheet Import.
The priority of a
template rule is specified by the priority
attribute on the
xsl:template
declaration. If no priority is specified
explicitly for a template rule, its default priority is used, as defined in 6.5 Default Priority for Template Rules.
There is another total ordering among groups referred to as
processing order. If group R precedes group
S in processing order, then in the result sequence returned by the
xsl:for-each-group
instruction the items generated by
processing group R will precede the items generated by processing group
S.
The software responsible for transforming source trees into result trees using an XSLT stylesheet is referred to as the processor. This is sometimes expanded to XSLT processor to avoid any confusion with other processors, for example an XML processor.
The result of invoking the selected component, after any required conversion to the declared result type of the component, is referred to as the raw result.
The process of identifying the component to which a symbolic reference applies (possibly chosen from several homonymous alternatives) is called reference binding.
The context within a stylesheet where an XPath expression appears may specify the required type of the expression. The required type indicates the type of the value that the expression is expected to return.
The XSLT namespace, together with certain other namespaces recognized by an XSLT processor, are classified as reserved namespaces and must be used only as specified in this and related specifications.
The term result tree is used to refer to any tree constructed by instructions in the stylesheet. A result tree is either a final result tree or a temporary tree.
Roaming: indicates that the nodes returned by an expression could be anywhere in the tree, which inevitably means that the construct cannot be evaluated using streaming.
Within a map, no
two entries have the same key. Two atomic
values K1
and K2
are the same key for this
purpose if the relation op:same-key(K1, K2, $UCC)
holds.
A
RelativePathExpr
is a scanning expression
if and only if it is syntactically equivalent to some motionless
pattern.
Type definitions and element and attribute declarations are referred to collectively as schema components.
The schema instance namespace
http://www.w3.org/2001/XMLSchema-instance
is used as defined
in [XML Schema Part 1]
The schema
namespace
http://www.w3.org/2001/XMLSchema
is used as defined in
[XML Schema Part 1]
A
schema-aware XSLT processor is an XSLT processor that implements
the mandatory requirements of this specification connected with the
xsl:import-schema
declaration, the
[xsl:]validation
and [xsl:]type attributes
, and the
ability to handle input documents whose nodes have type annotations other than
xs:untyped
and xs:untypedAtomic
. The mandatory
requirements of this specification are taken to include the mandatory requirements
of XPath 3.0, as described in [XPath 3.0]. A requirement is mandatory unless the specification includes
wording (such as the use of the words should or
may) that clearly indicates that it is optional.
Zero or more secondary results: each secondary result can be any sequence of items (as defined in [XDM 3.0]).
A selection pattern uses a subset of the syntax for path expressions, and is defined to match a node if the corresponding path expression would select the node. Selection patterns may also be formed by combining other patterns using union, intersection, and difference operators.
A sequence constructor is a sequence of zero or more sibling nodes in the stylesheet that can be evaluated to return a sequence of nodes, atomic values, and function items. The way that the resulting sequence is used depends on the containing instruction.
A SequenceType constrains the type and number of items in a sequence. The term is used both to denote the concept, and to refer to the syntactic form in which sequence types are expressed in the XPath grammar: specifically SequenceTypeXP30 in [XPath 3.0], or SequenceTypeXP31 in [XPath 3.1], depending on whether or not the XPath 3.1 Feature is implemented.
A frequent requirement is to output a final result tree as an XML document (or in other formats such as HTML). This process is referred to as serialization.
If a transformation has successfully produced a principal result or secondary result, it is still possible that errors may occur in serializing that result . For example, it may be impossible to serialize the result using the encoding selected by the user. Such an error is referred to as a serialization error.
A processor that claims conformance with the serialization feature must support the conversion of a final result tree to a sequence of octets following the rules defined in 26 Serialization.
A binding shadows another binding if the binding occurs at a point where the other binding is visible, and the bindings have the same name.
A simplified stylesheet, which is a subtree rooted at a literal result element, as described in 3.8 Simplified Stylesheet Modules. This is first converted to a standard stylesheet module by wrapping it in an xsl:stylesheet element using the transformation described in 3.8 Simplified Stylesheet Modules.
A singleton focus based on an item J has the context item (and therefore the context node, if J is a node) set to J, and the context position and context size both set to 1 (one).
A snapshot of a node N
is a deep copy of N, as produced by the xsl:copy-of
instruction with copy-namespaces
set to yes
,
copy-accumulators
set to yes
, and
validation
set to preserve
, with the additional property
that for every ancestor of N, the copy also has a corresponding ancestor
whose name, node-kind, and base URI are the same as the corresponding ancestor of
N, and that has copies of the attributes, namespaces and accumulator values of the
corresponding ancestor of N. But the ancestor has a type annotation of
xs:anyType
, has the properties nilled
,
is-id
, and is-idref
set to false, and has no children
other than the child that is a copy of N or one of its
ancestors.
Within a sort key specification, each
xsl:sort
element defines one sort key
component.
A sort key
specification is a sequence of one or more adjacent
xsl:sort
elements which together define rules for sorting the
items in an input sequence to form a sorted sequence.
For each item in the initial sequence, a value is computed for each sort key component within the sort key specification. The value computed for an item by using the Nth sort key component is referred to as the Nth sort key value of that item.
The sequence after sorting
as defined by the xsl:sort
elements is referred to as the
sorted sequence.
The term source tree
means any tree provided as input to the transformation. This includes the document
containing the global context item if any, documents containing
nodes present in the initial match selection,
documents containing nodes supplied as the values of stylesheet parameters, documents
obtained from the results of functions such as document
,
doc
FO30, and collection
FO30, documents read using the xsl:source-document
instruction, and documents returned by extension functions or
extension instructions. In the context of a particular XSLT instruction, the term
source tree means any tree provided as input to that instruction;
this may be a source tree of the transformation as a whole, or it may be a
temporary tree produced during the
course of the transformation.
A sort
key specification is said to be stable if its first
xsl:sort
element has no stable
attribute, or has
a stable
attribute whose effective
value is yes
.
There are a number of
standard attributes that may appear on any XSLT element: specifically
default-collation
, default-mode
,
default-validation
,
exclude-result-prefixes
, expand-text
, extension-element-prefixes
,
use-when
, version
, and
xpath-default-namespace
.
The standard error namespace
http://www.w3.org/2005/xqt-errors
is used for error codes
defined in this specification and related specifications. It is also used
for the names of certain predefined variables accessible within the scope
of an xsl:catch
element.
The standard function
namespace
http://www.w3.org/2005/xpath-functions
is used for functions
in the function library defined in [Functions and Operators 3.0] and
for standard functions defined in this specification.
A
standard stylesheet module, which is a subtree rooted at an
xsl:stylesheet
or xsl:transform
element.
An error that can be detected by examining a stylesheet before execution starts (that is, before the source document and values of stylesheet parameters are available) is referred to as a static error.
A static expression is an XPath expression whose value must be computed during static analysis of the stylesheet.
A static variable declared using an xsl:param
element
is referred to as a static parameter.
The static type of a construct is such that all values produced by evaluating the construct will conform to that type. The static type of a construct is a U-type.
A top-level
variable-binding element
having the attribute static="yes"
declares a static
variable: that is, a global variable whose value is
known during static analysis of the stylesheet.
Stylesheet functions belong to one of a number of streamability categories: the choice of category characterizes the way in which the function handles streamed input.
A streamable
mode is a mode that is declared in
an xsl:mode
declaration with the attribute
streamable="yes"
.
A streamed document is a source tree that is processed using streaming, that is, without constructing a complete tree of nodes in memory.
A streamed node is a node in a streamed document.
The term streaming refers to a manner of processing in which XML documents (such as source and result documents) are not represented by a complete tree of nodes occupying memory proportional to document size, but instead are processed “on the fly” as a sequence of events, similar in concept to the stream of events notified by an XML parser to represent markup in lexical XML.
A processor that claims
conformance with the streaming feature
must use streamed processing in cases where (a) streaming is
requested (for example by using the attribute streamable="yes"
on
xsl:mode
, or on
the xsl:source-document
instruction) and
(b) the constructs in question are guaranteed-streamable
according to this specification.
The first parameter of a declared-streamable stylesheet function is referred to as a streaming parameter.
Striding: indicates that the result of a construct contains a sequence of streamed nodes, in document order, that are peers in the sense that none of them is an ancestor or descendant of any other.
The term string value is defined in Section 5.13 string-value Accessor DM30. Every node has a string value. For example, the string value of an element is the concatenation of the string values of all its descendant text nodes.
A stylesheet consists of one or more packages: specifically, one top-level package and zero or more library packages.
An
xsl:function
declaration declares the name, parameters, and
implementation of a stylesheet function that can be called from any
XPath expression within the stylesheet
(subject to visibility
rules).
A stylesheet
level is a collection of stylesheet modules connected using xsl:include
declarations: specifically, two stylesheet modules A and
B are part of the same stylesheet level if one of them includes
the other by means of an xsl:include
declaration, or if there
is a third stylesheet module C that is in the same stylesheet level
as both A and B.
A package consists of one or more stylesheet modules, each one forming all or part of an XML document.
A top-level
xsl:param
element declares a stylesheet
parameter. A stylesheet parameter is a global variable with the additional
property that its value can be supplied by the caller when a transformation is
initiated.
The value of the variable is
computed using the expression given in the
select
attribute or the contained sequence constructor, as described in
9.3 Values of Variables and Parameters. This value is referred to as the
supplied value of the variable.
Every construct has a sweep, which is a measure of the extent to which the current position in the input stream moves during the evaluation of the expression. The sweep is one of: motionless, consuming, or free-ranging .
The symbolic identifier of a component is a composite name used to identify the component uniquely within a package. The symbolic identifier comprises the kind of component (stylesheet function, named template, accumulator, attribute set, global variable, key, or mode), the expanded QName of the component (namespace URI plus local name), and in the case of stylesheet functions, the arity.
The declaration of a component includes
constructs that can be interpreted as references to other components by means of their symbolic identifiers. These
constructs are generically referred to as symbolic references.
Examples of constructs that give rise to symbolic references are the
name
attribute of xsl:call-template
; the
[xsl:]use-attribute-sets
attribute of
xsl:copy
, xsl:element
, and literal result elements; the
explicit or implicit
mode
attribute of xsl:apply-templates
; XPath
variable references referring to global variables; XPath static function calls (including partial function
applications) referring to stylesheet functions; and
named function references (example: my:f#1
) referring to
stylesheet functions.
An instruction J is in a tail position within a sequence constructor SC if it satisfies one of the following conditions:
J is the last instruction in SC, ignoring any
xsl:fallback
instructions.
J is in a tail position
within the sequence constructor that forms the body of an
xsl:if
instruction that is itself in a tail position within SC.
J is in a tail position
within the sequence constructor that forms the body of an
xsl:when
or xsl:otherwise
branch of an
xsl:choose
instruction that is itself in a tail position within SC.
J is in a tail position
within the sequence constructor that forms the body of an
xsl:try
instruction that is itself in a tail position within SC (that
is, it is immediately followed by an xsl:catch
element,
ignoring any xsl:fallback
elements).
J is in a tail position
within the sequence constructor that forms the body of an
xsl:catch
element within an xsl:try
instruction that is itself in a tail
position within SC.
The string that results
from evaluating the expression in the xpath
attribute is referred to
as the target expression.
The namespace URI that is to be used in the result tree as a substitute for a literal namespace URI is called the target namespace URI.
An xsl:template
declaration defines a template, which contains a sequence constructor;
this sequence constructor is evaluated to determine
the result of the template. A template can serve either as a template rule, invoked by matching items against a pattern, or as a named
template, invoked explicitly by name. It is also possible for the
same template to serve in both capacities.
An
xsl:param
element may appear as a child of an
xsl:template
element, before any
non-xsl:param
children of that element. Such a parameter
is known as a template parameter. A template parameter is a
local variable with the
additional property that its value can be set when the template is called,
using any of the instructions xsl:call-template
,
xsl:apply-templates
, xsl:apply-imports
,
or xsl:next-match
.
A stylesheet contains a set of template rules (see 6 Template Rules). A template rule has three parts: a pattern that is matched against selected items (often but not necessarily nodes), a (possibly empty) set of template parameters, and a sequence constructor that is evaluated to produce a sequence of items.
The second of the two output states is called temporary output state. This state applies when instructions are writing to a temporary tree or any other non-final destination.
The term temporary tree means any tree that is neither a source tree nor a final result tree.
In a text node
that is designated as a text value template, expressions can be used by surrounding each
expression with curly brackets ({}
).
An element occurring as a child of an
xsl:package
,
xsl:stylesheet
,
xsl:transform
, or xsl:override
element is called a top-level element.
For a given transformation, one package functions as the top-level package. The
complete stylesheet is assembled by finding
the packages referenced directly or indirectly from the top-level package using
xsl:use-package
declarations: see 3.5.2 Dependencies between Packages.
An operand usage of transmission indicates that the construct will (potentially) return a supplied node as part of its result to the calling construct (that is, to its parent in the construct tree).
A traversal of a tree is a sequence of traversal events.
a traversal event (shortened to event in this section) is a pair comprising a phase (start or end) and a node.
The term tree is used (as in [XDM 3.0]) to refer to the aggregate consisting of a parentless node together with all its descendant nodes, plus all their attributes and namespaces.
A parameter passed to a template may be defined as a tunnel parameter. Tunnel parameters have the property that they are automatically passed on by the called template to any further templates that it calls, and so on recursively.
The term type
annotation is used in this specification to refer to the value returned
by the dm:type-name
accessor of a node: see Section
5.14 type-name Accessor
DM30.
Certain errors are classified as type errors. A type error occurs when the value supplied as input to an operation is of the wrong type for that operation, for example when an integer is supplied to an operation that expects a node.
The type-adjusted posture and sweep of a construct C, with respect to a type T, are the posture and sweep established by applying the general streamability rules to a construct D whose single operand is the construct C, where the operand usage of C in D is the type-determined usage based on the required type T.
The
type-determined usage of an operand is as
follows: if the required type (ignoring occurrence indicator) is
function(*)
or a subtype thereof, then inspection; if the required type (ignoring occurrence indicator) is an atomic or union type, then absorption; otherwise navigation.
The term typed
value is defined in Section
5.15 typed-value Accessor
DM30.
Every node, other than an element whose type
annotation identifies it as having element-only content, has a
typed value. For example, the
typed value of an attribute of
type xs:IDREFS
is a sequence of zero or more
xs:IDREF
values.
A U-type is a set of fundamental item types.
The unnamed mode is the default mode used when no
mode
attribute is specified on an
xsl:apply-templates
instruction or
xsl:template
declaration, unless a different default mode
has been specified using the [xsl:]default-mode
attribute of a containing
element.
Within this specification, the
term URI Reference, unless otherwise stated, refers to a string in
the lexical space of the xs:anyURI
datatype as defined in [XML Schema Part 2].
If a package Q contains an
xsl:use-package
element that references package
P, then package Q is said to use package
P. In this relationship package Q is referred to as
the using package, package P as the used
package.
In addition to
declarations, the
xsl:stylesheet
element may contain among its children any
element not from the XSLT namespace,
provided that the expanded QName of
the element has a non-null namespace URI. Such elements are referred to as
user-defined data elements.
An item is vacuous if
it is one of the following: a zero-length text node; a document node with no children;
an atomic value which,
on casting to xs:string
, produces a zero-length string; or (when XPath 3.1 is supported) an array
which on flattening using the array:flatten
FO31 function produces either an empty sequence
or a sequence consisting entirely of vacuous items.
A variable is a binding between a name and a value. The value of a variable is any sequence (of nodes, atomic values, and/or function items), as defined in [XDM 3.0].
Collectively, attribute value templates and text value templates are referred to as value templates.
The xsl:variable
element
declares a variable, which may be a global variable or a local
variable.
The two
elements xsl:variable
and xsl:param
are referred to
as variable-binding elements
The visibility of a
component is one of:
private
, public
, abstract
,
final
, or hidden
.
A whitespace text node is a text node whose content consists entirely of whitespace characters (that is, #x09, #x0A, #x0D, or #x20).
The XML
namespace, defined in [Namespaces in XML] as
http://www.w3.org/XML/1998/namespace
, is used for
attributes such as xml:lang
, xml:space
, and
xml:id
.
The term
XPath 1.0 compatibility mode is defined in Section
2.1.1 Static Context
XP30. This is a setting in the static
context of an XPath expression; it has two values, true
and
false
. When the value is set to true, the semantics of
function calls and certain other operations are adjusted to give a greater
degree of backwards compatibility between XPath
3.0 and XPath 1.0.
A processor that claims conformance with the XPath 3.1 feature must implement XPath 3.1 (including [XPath 3.1], [XDM 3.1], [XSLT and XQuery Serialization 3.1], and [Functions and Operators 3.1]).
An element in the stylesheet is processed with XSLT 1.0 behavior if its effective version is equal to 1.0.
A processor that claims conformance with the XSLT 1.0 compatibility feature must support the processing of stylesheet instructions and XPath expressions with XSLT 1.0 behavior, as defined in 3.9 Backwards Compatible Processing.
An element is processed with XSLT 2.0 behavior if its effective version is equal to 2.0.
An XSLT element is an element in the XSLT namespace whose syntax and semantics are defined in this specification.
An XSLT
instruction is an XSLT element
whose syntax summary in this specification contains the annotation <!--
category: instruction -->
.
The XSLT namespace
has the URI http://www.w3.org/1999/XSL/Transform
. It is used to
identify elements, attributes, and other names that have a special meaning defined
in this specification.