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

RE: variable incrementing problems

Subject: RE: variable incrementing problems
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Tue, 29 Jun 1999 10:35:01 -0600
incrementing jsp variable
> On Mon, 28 Jun 1999, Kay Michael wrote:
> > You cannot use xsl:variable to assign a new value to
> > an existing variable
> 
> Ok. Thanks for answer. I am solved my problem now.
> But how can I increment value already existing variable?
> 
> Another question: I am declare variable (DebubOpts) in
> template that should match root element. This template
> call another templates. But there is no variable
> DebugOpts in "child's" templates that called from main
> template....??

The child template is treated specially; it is outside the scope of the
calling template. To pass a variable to a called template, you need to use
param and param-variable, like this:

<xsl:template match="/">
    <xsl:variable name="DebugOpts" expr="abc123"/>
    <xsl:call-template name="childTemplate">
        <xsl:param name="DebugOpts" expr="$DebugOpts"/>
    </xsl:call-template>
</xsl:template>

<xsl:template name="childTemplate">
    <xsl:param-variable name="DebugOpts"/>
    <xsl:text>The value of $DebugOpts is: </xsl:text>
    <xsl:value-of select="$DebugOpts"/>
</xsl:template>

This technique can be used to pass parameters back and forth between
templates. An increment function could be simulated this way.


 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.