When I saw this earlier, I just assumed it was meant to function this way, but you requested I send in a note if I got a saxon local error.

If you try to use a local variable to set default parameter values in XSL:Iterate, an error is thrown:
This is with Saxon EE
Description: *** Internal Saxon error: local variable encountered whose binding has been deleted

Here is an example of a simple script that throws the error:

<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    <xsl:template match="/">
        <xsl:variable name="children" select="count(//child)"/>
        <xsl:iterate select="//child">
            <xsl:param name="size" select="$children"/>
            <xsl:value-of select="concat('The age of this child is ',age,'.')"/>


Source file:



"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.