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

What to use instead of a mutable variable ?

Subject: What to use instead of a mutable variable ?
From: IceT <icetbr@xxxxxxxxxxxx>
Date: Sun, 17 Aug 2003 00:52:09 -0300
mutable variable
Hello everebody,

I have something like this code in my xsl

<xsl:template match="insertItem">
<xsl:for-each select="$book/itens"> <xsl:apply-templates select="$layout//insertItens/*" />
</xsl:for-each>
</xsl:template>


<xsl:template match="insertName">
   <xsl:value-of select="$book/itens/name"/>
</xsl:template>

<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*|node()" /> </xsl:copy>
</xsl:template>


How can I make the template "insertItens" to use a diferrent name everytime it is called? I want to achieve something like

<xsl:template match="insertName">
    <xsl:param name="position" />
   <xsl:value-of select="$book/itens/name[$position]"/>
</xsl:template>

though I ca't call this template directly, because there is some nodes tha need to be "copied" to the output first when the "for each" is being processed. I needed an alterable global variable, but that is not possible in XSL.

Did I explain the situation correctly?


Thanks.


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.