Project

Profile

Help

Inconsistency between normal accumulator and streaming ac... » acc-phase-end-streaming-sax-capture1.xsl

Martin Honnen, 2018-10-02 22:22

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:saxon="http://saxon.sf.net/"
exclude-result-prefixes="#all"
expand-text="yes"
version="3.0">
<xsl:mode on-no-match="shallow-copy" use-accumulators="#all" streamable="yes"/>
<xsl:accumulator name="items" as="element(item)*" initial-value="()" streamable="yes">
<xsl:accumulator-rule phase="end" match="item" select="$value, ." saxon:capture="yes"/>
</xsl:accumulator>
<xsl:template match="item">
<xsl:next-match/>
<xsl:message>item: {string(@id)}, count(accumulator-after("items")): {count(accumulator-after('items'))}, accumulator-after("items")!@id!string(): {accumulator-after("items")!@id!string()}</xsl:message>
</xsl:template>
</xsl:stylesheet>
(3-3/4)