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

RE: Should variable resolution be done at compile-time

Subject: RE: Should variable resolution be done at compile-time or run-time?
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Fri, 17 Oct 2003 22:22:26 -0500
compile time variable
> The XSLT 1.0 spec says how the scope of variables is determined,
> but not when.  Is this a known gray area?  I just had a brief look,
> but XSLT 2.0:9.7 "Scope of Variables" doesn't specify this either.
> I know I would prefer this to be checked at compile-time, particularly
> with complex stylesheets with large numbers of rules and cases.

Are you asking when the stylesheet processor checks that variable references
are in scope of their referenced variables?

The scope of a variable is "determined" (i.e. knowable and unchangeable)
even before compile time. I'm not sure what it would mean to ask when
a stylesheet processor determines the scope of a variable.
Some might never do so, except when checking that referenced variables
are in scope.

As your experiment showed, some processors (Saxon) checked variable
references at compile time, others (Xalan, .NET) only at run time.

The spec leaves this question open, as it tends to do on questions
of efficiency. Stylesheet processors are free to optimize but aren't
forced to.

Lars


 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.