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

RE: Reference to variable cannot be resolved.

Subject: RE: Reference to variable cannot be resolved.
From: "Martinez, Brian" <brian.martinez@xxxxxxxx>
Date: Thu, 13 Feb 2003 12:46:46 -0700
brian martinez
> 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


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.