|
[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
> 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
|
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








