This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Understanding difficulties with call-template



Hi don't see the need for the param, doesn't this work:


 <xsl:template name="comma-block">
         <xsl:for-each select="preferred-location">
                 <xsl:value-of select="."/>
                 <xsl:if test="position() != last()">, </xsl:if>
         </xsl:for-each>
 </xsl:template>

 <xsl:template match="preferred-locations">
 <xsl:element name="p">
 Preferred Locations:
 <xsl:call-template name="comma-block"/>
 </xsl:element>
 </xsl:template>
of course you probably wanted it in order to have a more resusable template
which would make sense.

Benoit

> OK got it working here this works.
>
> <xsl:template name="comma-block">
>         <xsl:param name="nodes"/>
>         <xsl:for-each select="$nodes">
>                 <xsl:value-of select="."/>
>                 <xsl:if test="position() != last()">, </xsl:if>
>         </xsl:for-each>
> </xsl:template>
>
> <xsl:template match="preferred-locations">
> <xsl:element name="p">
> Preferred Locations:
> <xsl:call-template name="comma-block">
>         <xsl:with-param name="nodes" select="preferred-location"/>
> </xsl:call-template>
> </xsl:element>
> </xsl:template>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]