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

Re: About <xsl:param> and <xsl:with-param>

Subject: Re: About <xsl:param> and <xsl:with-param>
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Tue, 5 Nov 2002 12:40:21 -0000
xslt reassign param
Hi,
>In the next xsl I want to make that the param "cod" be >incremented in each
time that the <xsl:for-each> cicle >occurs, but it's result is an error
 you can not incriment the
variables in XSLT.
it's not possible in XSLT, because you can't reassign the value of a
variable..
You may use other techniques like recursive templates to solve your
problem.. or If you tell what your requirement is , some one in the list can
definitely help you out.


><xsl:with-param name="cod" select="number($cod+1)"/>
This is a wrong usage of xsl:with-param ..
<xsl:with-param > is used when calling a template by using
either <xsl:call-templates> or <xsl:apply-templates> .

a typical use of <xsl:param> and <xsl:with-param> :

<xsl:template match="/">
    <xsl:call-template name="my-template">
        <xsl:with-param name="param1" select="'param1 value'"/>
        <xsl:with-param name="param2" select="'param2 value'"/>
    </xsl:call-template>
</xsl:template>

<xsl:template name="my-template">
    <xsl:param name="param1"/>
    <xsl:param name="param2"/>
    Param Values : <xsl:value-of select="$param1"/> and <xsl:value-of
select="$param2"/>
</xsl:template>

HTH

Vasu



 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.