[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

passing parameters between templates

Subject: passing parameters between templates
From: Peter Lavender <plaven@xxxxxxxxxxxxxx>
Date: Sun, 20 Oct 2002 14:55:32 +1000
lavender templates
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:call-template>
            </td>
            </tr>
        </xsl:for-each>
        </table>
    </xsl:template>

    
    <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" />
            <td>
            <input type="radio"
                        name="{$appIn}"
                       value="{$value}" />
                <xsl:value-of select="word"/>
            </td>
            
        </xsl:for-each>
        <xsl:if test="$teach = 'yes'">
            <td><input type="checkbox" name="{$appIn}-chk">Willing to
teach others</input></td>
        </xsl:if>
        </table>
    </xsl:template>

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

Thanks.


Pete.

-- 
				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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.