[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Testing if something is not there
Hi Mike, > Saxon currently evaluates all variables except node-set variables at > the time they are declared. For node-set variables, it evaluates the > select expression the first three times the variable is referred to; > the third time, it saves the value of the variable in memory. This > is a time/space trade-off: for many simple node-set expressions such > as "following-sibling::*", allocating space to hold the value is > more expensive than re-evaluating it on each reference. Ahh... I'd misinterpreted/misremembered what you'd said at XSLT-UK about this. Thanks for the clarification. So with Saxon as the processor, it's worth putting an expression into a variable if it's (a) likely to be expensive to compute *and* (b) going to be executed more than three times in the same context. [Jim: I forgot the other aspect of using variables which is handy, namely for maintenance it's easier to refer to complicated expressions than repeat them in the code.] Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|