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

Re: Assigning value to variable based on xsl:choose te

Subject: Re: Assigning value to variable based on xsl:choose test
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 24 Jul 2006 10:24:41 +0100
xslt assigning value to variable
> Is it possible to set the value of a variable based upon a test?

yes but the logic of the syntax follows that english description, not
the syntax that you might be familiar with from some other programming
languages. You want _a_ variable binding, the _value_ of which depends on
an boolean test, so that's

<xsl:variable name="numTickets">
<xsl:choose>
 	<xsl:when test="price_type = 56">8</xsl:when>
 	<xsl:when test="price_type = 57">4</xsl:when>
        <xsl:otherwise>9</xsl:otherwise>
</xsl:choose>
</xsl:variable>

David

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.