Project

Profile

Help

Inconsistency between normal accumulator and streaming ac... » acc-phase-end-not-streaming1.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"
exclude-result-prefixes="#all"
expand-text="yes"
version="3.0">
<xsl:mode on-no-match="shallow-copy" use-accumulators="#all"/>
<xsl:accumulator name="items" as="element(item)*" initial-value="()">
<xsl:accumulator-rule phase="end" match="item" select="$value, ."/>
</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>
(2-2/4)