|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Reference to variable cannot be resolved.
> From: Wendell Piez [mailto:wapiez@xxxxxxxxxxxxxxxx] > Sent: Thursday, February 13, 2003 12:14 PM > Subject: Re: Reference to variable cannot be resolved. > > Imrran, > > Bind the lookup node set to its variable globally, i.e. outside any > templates. Then it will be in scope for any template. > > It also means that the expensive document('lookup.xml') call > will happen > once, not every time a given template is hit. Not all > processors optimize this. Oops, good point. My solution would be quite expensive in that context. Perhaps if the variable was bound in the root template (i.e. match="/"), then one document() call would suffice provided you passed the lookup node as a param when needed. It could just be a matter of style, but I try to avoid using global variables unless absolutely necessary. As a side question, what effect is there in terms of performance or efficiency in having a lot of global variables declared? The few programming classes I've taken (using procedural languages) have taught that a lot of global variables are a Bad Thing, but maybe that axiom doesn't necessarily apply to XSLT. b. | brian martinez brian.martinez@xxxxxxxx | | senior gui programmer 303.708.7248 | | trip network, inc. fax 303.790.9350 | | 6436 s. racine cir. englewood, co 80111 | | http://www.cheaptickets.com/ http://www.trip.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
|

Cart








