Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Although most XPath expressions return nodes in document order, not all do so. For example, the expression
title, author, publisher
returns a sequence containing first the child
title
elements, then the child
author
elements, and then the child
publisher
elements of the context node, regardless of the order that these nodes appear in the source document. The nodes returned by the XPath expression will be processed in the order of the sequence that is returned, not necessarily in document order.
If there are one or more
select
expression, unless the first
stable=“no”
, in which case there are no guarantees.
Choosing a Template Rule
For each node to be processed, a template rule is selected. The choice of a template rule is made independently for each selected node; they may all be processed by the same template rule, or a different template rule may be chosen for each one.
The template rule selected for processing a node will always be either an
match
attribute, or a built-in template rule provided by the XSLT processor.
An
mode
: That is, the
mode
attribute of the
mode
attribute of the
#all
to indicate that it matches all modes. If the
mode
attribute, or if its
mode
attribute includes the keyword
#default
, then the template rule matches the default mode, which is the mode that is used when
mode
attribute. If the mode name contains a namespace prefix, it is the namespace URI that must match, not necessarily the prefix itself. Alternatively, the
mode=“#current”
to continue processing in the current mode. This is useful when the instruction is contained in a template rule that can be invoked in a number of different modes. The concept of the
current mode
is explained more fully in the section for
Note that if the
mode
attribute is omitted, it makes no difference what mode was originally used to select the template rule containing the
mode
attribute. If you want to continue processing in the current mode, either specify the mode explicitly, or set
mode=“#current”
.