You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Cook, Jim x66261" <JC...@bis.adp.com> on 2001/10/24 02:50:46 UTC

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>