Defines a rule for an
Available in XSLT 3.0. From Saxon 9.8, available in all editions. Implemented in Saxon-PE and Saxon-EE since Saxon 9.6.
- Content: sequence-constructor
- Permitted parent elements:
- Pattern defining the set of nodes to which the accumulator rule applies.
"start" | "end"
- Determines whether the rule fires before or after descendants are processed, by specifying
phase="start"(the default) or
- The expression to be evaluated by the rule may be given either by a select attribute, or by an enclosed sequence constructor.
- The value
phase="end"rule for a streaming accumulator removes the requirement for the select attribute (or sequence constructor) to be motionless. Instead the expression has access to a snapshot of the streamed node (in the sense of the
fn:snapshotfunction). For example, writing
select="($value, .)"ensures that the value of the accumulator contains a sequence of snapshot copies of all the element nodes matched by the accumulator rule. For details see
For an example of the use of a capturing accumulator rule to construct the glossary of a document, see the blog article Capturing Accumulators.