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

Re: variable

Subject: Re: variable
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Aug 2001 10:47:03 +0200 (MET DST)
Re:  variable
Hi Eric,

> is there a way to change the value of a parameter or a variable after it's 
> been declared?  like with an if statement?

No.

> 		<xsl:param name="color">123456</xsl:param>
> 		<xsl:if test="ancestor::top_bar">
> 			<xsl:param name="color">ffffff</xsl:param>
> 		</xsl:if>
> 		<xsl:if test="ancestor::bottom_bar">
> 			<xsl:param name="color">000000</xsl:param>
> 		</xsl:if>
> 
> It doesn't seem to work with variables or parameters.  is there some other 
> way?

You can declare a new variable like this:

<xsl:param name="color">123456</xsl:param>
<xsl:variable name="color2">
   <xsl:choose>
      <xsl:when test="ancestor::top_bar">ffffff</xsl:when>
      <xsl:when test="ancestor::bottom_bar">000000</xsl:when>
      <xsl:otherwise><xsl:value-of select="$color" /></xsl:otherwise>
   </xsl:choose>
</xsl:variable>

Now $color2 contains the value you want.
Hope that helps,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 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.