From 6df49c1be9cbdb25c231672f2dc30ec0da1eb9f6 Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Tue, 26 Sep 2023 17:36:58 +0100 Subject: [PATCH] Revised to take account of comments --- specifications/xslt-40/src/xslt.xml | 32 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/specifications/xslt-40/src/xslt.xml b/specifications/xslt-40/src/xslt.xml index b63d8aef8..3813cba4b 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -26479,19 +26479,23 @@ the same group, and the-->

This means that an accumulator that needs access to the typed value or string value of an element can get this directly with a rule that matches the element, avoiding the need - to write rules that match the element's text node children. + to write rules that match the element’s text node children.

For example, to capture a copy of the most recent h2 element in a document, the following accumulator might be declared:

- + ]]>

and subsequent processing wishing to copy the most recent h2 element into the result tree can simply use <xsl:copy-of select="accumulator-before('most-recent-h2')"/>.

+

Without the capture="yes" attribute, this accumulator would be rejected + as non-streamable, because the select expression on the accumulator rule + is consuming.

+ @@ -26510,10 +26514,21 @@ the same group, and the--> capture="yes" select="map:put($value, @term, .)"/> ]]> -

At the end of processing, the map containing all the terms and their definitions (including - the internal markup) is available as the value - of accumulator-before('glossary-terms'), and this can be sorted and rendered in the usual way.

- +

Suppose that the input XML document contains an element <glossary/> marking + the point where the glossary is to be inserted. The glossary can then be generated + using a template rule such as:

+ +

Glossary

+
+ + +
{?key}
+
+
+
+]]>
+ +
@@ -26561,7 +26576,10 @@ the same group, and the--> the expression in the select attribute or the contained , with respect to the declared type of the accumulator, is and .

-

The rule has capture="yes".

+

The rule has capture="yes" and the of + the expression in the select attribute or the contained + + is or .