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

Re: choose/when question

Subject: Re: choose/when question
From: Jo Bourne <venus@xxxxxxxxx>
Date: Wed, 22 Aug 2001 20:17:26 +1000
jeni jo
thank heaps Jeni!

At 10:26 AM +0100 22/8/01, Jeni Tennison wrote:
>Hi Jo,
>
>> the result of the two when statements are identical, it is only the
>> otherwise that has different behaviour. I am wondering if it would
>> have any noticible effect on performance to combine the two when
>> statements into one? and if it would how would i do this? is like
>> this:
>
>It probably wouldn't have any noticeable effect on performance, but it
>would make your stylesheet more maintainable. You can combine the two
>conditions with an 'or', as follows:
>
>  <xsl:choose>
>    <xsl:when test="@number = 'one' or @number = 'two'">
>      ...
>    </xsl:when>
>    <xsl:otherwise>
>      ...
>    </xsl:otherwise>
>  </xsl:choose>
>
>There's no simple way of checking whether the value of @number is in a
>list in the way that you tried, although you could hold them in some
>XML and test against that, or you could do something like:
>
>  contains(':one:two:', concat(':', @number, ':'))
>
>The separate tests are probably clearer unless you have a large number
>of possible values.
>
>I hope that helps,
>
>Jeni
>
>---
>Jeni Tennison
>http://www.jenitennison.com/
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


-- 
Jo Bourne
Virtual Artists Pty Ltd

 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.