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

Re: Several rules vs a single rule with a choose opera

Subject: Re: Several rules vs a single rule with a choose operator
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Sun, 29 Jul 2001 16:57:36 GMT
Re:  Several rules vs a single rule with a choose opera
>Trevor Nash wrote:
>> My advice would be to choose the method that is going to be easiest to
>> change - probably the separate templates route.  As to performance, it
>> is true for most software systems that time spent getting the overall
>> design right is much more valuable than time spent on the minute
>> details of implementation.  In short, stop worrying about it.
>
>Thanks for the advice, Trevor
>(as well as for those I have deleted (but not forgot)).
>
>> >  <xsl:template match="node-test[condition2]" priority="2">
>
>> You only need the priority if condition1 and condition2 are not
>> mutually exclusive.
>
>Yes, they need not be mutually exclusive.
>
>> In which case I wonder why you are not testing
>> the common part in the 'choose' method?
>
>Hmm... Because there is no need. :-)
>The two approaches I presented are equivalent in all cases, aren't they?

Logically equivalent yes, but here we are considering performance.
You probably should not need to know - but there are techniques for
coding conditionals based on formula rewriting and statistical
analysis of the input data.  I have only ever used them for compilers
and the guts of an operating system, so its probably off-topic for
this list.  But if your conditions are expensive to evaluate you may
want to think about expressing them in a different way (and a
different order) so that on average the answer comes out quicker.

Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 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.