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

Re: Re:Re:How to robustly handle mulple conditions in

Subject: Re: Re:Re:How to robustly handle mulple conditions in xslt format
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 25 May 2001 13:21:51 +0100
dynamically named variables javascript
Hi Sun-Fu,

> Thanks for nice input of building XML structure to handle multiple
> conditions. It is certainly a good suggestions I can use. But I
> start to worry about the performance problem from using the
> complicated predicates.

Sure, but that's a price that you have to pay for the flexibility of
having dynamically named variables. However, in your example you
*know* what variables you have: $month, $dayID etc.. If you always
want to test those anyway, why don't you just hard code them into the
stylesheet? Why do you need to have dynamically named variables if
you're always using the same variables?

If you want them defined from two string parameters being passed into
the stylesheet, then why not set them up with things like:

<xsl:variable name="month" select="$variables[@name = 'month']" />
<xsl:variable name="dayID" select="$variables[@name = 'dayID']" />
...

Better still, pass in the parameters separately, using the Javascript
to assign values with .addParameter().

I'd only suggest that you use the kind of $variables XML if you can't
predict the names of the variables that you'll need to reference. If
that's the case and you're worried about performance, you could always
use keys to make it a bit more efficient (though it'll make the XSLT
more complicated because you'll need to change context to the
$variables node set to find variable elements with that key value
within that node set - it's like a separate document).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.