Re: [xsl] document() and keys

Subject: Re: [xsl] document() and keys
From: spam-from-xsl-list@xxxxxxxxxxxx
Date: 14 Nov 2001 00:58:20 +0000
Hi Jeni,

    Phil> The problem is that I want to pass the selected node as a
    Phil> parameter to a named template.  I have tried this:
    Phil> <xsl:call-template.....>
    Phil>   <xsl:for-each select="$src-root">
    Phil>     <xsl:with-param .... select="key(keyname,...)"/>
    Phil>   </xsl:for-each>
    Phil> </xsl:call-template>

    Jeni> Try putting the xsl:for-each around the xsl:call-template:
    Jeni> <xsl:for-each select="$src-root">
    Jeni>   <xsl:call-template ...>
    Jeni>     <xsl:with-param ... select="key(keyname, ...)" />
    Jeni>   </xsl:call-template>
    Jeni> </xsl:for-each>

Unfortunately I need the current node to be unchanged over the

I guess I could make the current node a parameter:

<xsl:variable name="dot" select="."/>
<xsl:for-each select="$src-root">
    <xsl:with-param name="dot" select="$dot"/>
    <xsl:with-param .... select="key(keyname,...)"/>

<xsl:template name="...">
  <xsl:param name="dot"/>
  <xsl:for-each select="$dot">

but I think that's pretty horrible.   Isn't there a better way?

Thanks for your reply.


 XSL-List info and archive:

Current Thread