Subject:Global variable not visible from included stylesheet Author:Tim Crews Date:30 Jul 2007 11:58 PM Originally Posted: 30 Jul 2007 11:54 PM
I am running an evaluation version of the Home edition of Stylus Studio.
I have an XSLT 2.0 stylesheet that includes several other stylesheets. The main stylesheet defines a variety of global variables, outside the context of any template.
I define a scenario that uses the Saxon 8.9.0.3 engine. (Independently of Stylus Studio, I have already successfully run this stylesheet using Saxon 8.9).
When I attempt to debug this collection of style sheets, the first time one of the included stylesheets references one of the global variables from the main stylesheet, an error message appears indicating that the global variable has not been declared.
Again, if I use the same version of the Saxon processor to run my stylesheet, but outside of Stylus Studio, the Saxon processor makes no such complaint.
Subject:Global variable not visible from included stylesheet Author:Ivan Pedruzzi Date:31 Jul 2007 01:37 AM
Hi Tim,
This is a behaviour that shows only when running on Java 1.6.
The problem will be fixed in the next Stylus Studio update.
Could you please confirm that you are running JRE 1.6?
Subject:Global variable not visible from included stylesheet Author:Tim Crews Date:31 Jul 2007 12:48 PM
This setting is disabled when using the Saxon 8.9.0.3 processor, which I have to use because my stylesheet is XSLT 2.0.
However, it appears that my problem had an entirely different cause. I thought (or assumed) that scenarios were attached to projects, as opposed to XSLT source files. When I created my scenarios, they were actually attached to one of the stylesheets that was included from the main stylesheet, when I should have attached the scenarios to the main stylesheet itself.
So, when I ran the scenario, only the included stylesheet was executed, and it was missing all of the declarations that would have come from the main stylesheet.
Once I defined and ran the scenario from the main stylesheet, I stopped getting the error messages about undefined variables.