Title: using count()

We are trying to get the count() function to work properly.  The following code gives us an "Unknown method.

-->count(.<--)" error message.  Our XML & XSL files are shown below. 

Any ideas
TIA Jim Cook

XML

<?xml version="1.0"?>
<permissions>
        <product>
                <name >TEST1</name>
                <entitled>1</entitled>
                <title>Tools</title>
                <function>
                        <name sequence="2">item1</name>
                        <entitled>1</entitled>
                        <allowed>1</allowed>
                        <subtitle>First Item</subtitle>
                </function>
                <function>
                        <name sequence="2">item2</name>
                        <entitled>1</entitled>
                        <allowed>1</allowed>
                        <subtitle>Second Item</subtitle>
                </function>
        </product>
</permissions>


XSL

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
        <xsl:template match="/">
        <html>
                <body>
                <xsl:apply-templates select="/*/product" />
                </body>
        </html>
        </xsl:template>

        <xsl:template match="product">
                <xsl:value-of select="count(.)" />
        </xsl:template>
</xsl:stylesheet>

Reply via email to