|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: variable incrementing problems
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








