Today I tried to use accumulators for the first time.

I ran into "Unknown System Function accumulator-before" .

This is the first time in quite a while that I've had trouble using advanced functionality. I'm using Saxon 9.5.1.3 within oXygen.

Sample file:


<xsl:stylesheet version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
    xmlns:err="http://www.w3.org/2005/xqt-errors"
    xmlns:saxon="http://saxon.sf.net/">

    <xsl:accumulator name="test" as="xs:integer"
        initial-value="0">
        <xsl:accumulator-rule match="item[@type='echo']" new-value="$value"/>
    </xsl:accumulator>
   
    <xsl:template match="/">
        <xsl:for-each select="//item">
            <xsl:value-of select="accumulator-before('test')"/>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

What am I missing?

Thanks,
David

--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.