[xsl] passing parameters between templates

Subject: [xsl] passing parameters between templates
From: Peter Lavender <plaven@xxxxxxxxxxxxxx>
Date: Sun, 20 Oct 2002 14:55:32 +1000
Hi everyone,

Can I send more than one parameter to a template like so:

    <xsl:template name="applications">
    <table border="1">
        <xsl:for-each select="$comp_ass/competancy/application">
            <xsl:variable name="app" select="."/>
            <tr><td><b><xsl:value-of select="$app" /></b></td>
            <td> <!--Param:<xsl:value-of select="$app"/> -->
            <xsl:call-template name="choicesGeneral">
                <xsl:with-param name="appIn" select="$app" />
                <xsl:with-param name="teach" select="yes" />
                <xsl:with-param name="type" select="general"/>

    <xsl:template name="choicesGeneral">
        <!-- get the parameters passed in: -->
        <xsl:param name="appIn" />
        <xsl:param name="teach"/>
        <xsl:param name="type"/>
        <h2>Param: appIn</h2><xsl:value-of select="$appIn"/><br/>
        <h2>Param: teach</h2><xsl:value-of select="$teach"/><br/>
        <h2>Param: type</h2><xsl:value-of select="$type"/><br/>
        <table border="1">
        <!-- <xsl:variable name="app"
select="$comp_ass/competancy/application"/> -->
        <xsl:for-each select="$rating/rating[@type='general']">
            <xsl:variable name="value" select="@value" />
            <input type="radio"
                       value="{$value}" />
                <xsl:value-of select="word"/>
        <xsl:if test="$teach = 'yes'">
            <td><input type="checkbox" name="{$appIn}-chk">Willing to
teach others</input></td>

What I am trying to achieve is a constant table, but based on
variables create it in certain ways.



				Due to a lack of imagination, 
				this signature will remain 
				under construction indefinitely.

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

Current Thread