[xslt] What does "Invalid number of arguments" mean?



Hello,

In my XSLT I get this error message from xsltproc:
XPath error : Invalid number of arguments

No template, line number, or other identifier. What does it mean?

This is the code which I think triggers it:

   <xsl:template name="fullName">
        <xsl:param name="path"  />
        <xsl:param name="element"  />
        <xsl:variable name="part" select="$element/../c:directory/@name" />

        <xsl:message>TEST: <xsl:value-of select="$part" /> </xsl:message>

        <xsl:choose>
            <xsl:when test="string-length($part)">
                <xsl:message>TEST yes</xsl:message>
                <xsl:call-template name="fullName">
                    <xsl:with-param name="path" select="concat( $path, '/', 
$part )" />
                    <xsl:with-param name="element"
                        select="$element/../../c:directory" />
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:message>TEST no</xsl:message>
                <xsl:value-of select="$path" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

[...]

                <xsl:call-template name="fullName">
                    <xsl:with-param name="element" select="." />
                </xsl:call-template>


This is the output, more specifically:

TEST: foo
TEST yes
TEST: playground
TEST yes
TEST:
TEST no
XPath error : Invalid number of arguments

So, it appears as when the xsl:otherwise clause kicks in, and the recursive 
function unwinds, the message occurs. What is wrong with the XSLT?

If I can make a stripped down test case which triggers this, IMHO, difficult 
to interpret message, would it be of interest?


Cheers,

		Frans




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]