I am trying to pass a node as a parameter from a named template to another named template but it doesn't work. It works in the first one, but not in the second level call. It complains about trying to convert from java.lang.String to node-set. I am using xslt1.0. Any ideas? Thanks
<xsl:template match="whatever">
<xsl:call-template name="first">
<xsl:with-param name="node" select="somenode1/somenode2"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="first">
<xsl:param name="node"/>
<xsl:for-each select="$node/xxx">
<!-- THIS WORKS FINE -->
</xsl:for-each>
<xsl:call-template name="second">
<xsl:with-param name="anothernode" select="$node"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="second">
<xsl:param name="anothernode"/>
<xsl:for-each select="$anothernode/yyy">
<!-- IT DIES IN THIS FOR-LOOP -->
</xsl:for-each>
</xsl:template>