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

Re: Modify Variable value

Subject: Re: Modify Variable value
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 26 Apr 2007 14:10:09 +0200
Re:  Modify Variable value
Senthilkumaravelan K wrote:
Hi ,
cna you give me the example how I could do that?
Regards,
Senthil


I suggest you read any good tutorial book which explains how and when apply-templates, call-template, for-each etc are used, and more especially, why it is so useful not to be able to assign to variables, it will save you countless of headbanging hours ;-) One suggestion would be Jeni Tennisons book Beginning XSLT 2.0 (there's also a 1.0 version).


An example with an 'assigned' (not the right word) parameter:

<xsl:template match="/">
  <xsl:apply-templates select="my-selection">
     <xsl:with-param name="my-param" select="10" />
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="my-selection">
  <xsl:param name="my-param" />
  <xsl:value-of select="$my-param" />
  <xsl:value-of select="." />
</xsl:template>

Will output whatever is the value of the node /my-selection with '10' prepended.

Cheers,
-- Abel

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.