Variable Scoping Errors
Posted: Wed Jun 13, 2012 1:26 am
Oxygen reports errors in XSL transforms if a variable was not defined in the same file; its lexical scope. The variables are global in nature declared in a master XSL file that imports the one I'm using as well as many others.
Is there a switch of some type to tell oXygen to look within a directory structure to see if the variable is defined and to not show it as an error.
I don't like globals in general, but this is not my code base and I'm new to XSL. For now, I've been equating a global variable within my files to its global equivalent so that the error that oXygen reports is at the top of the file where I expect it to be. This removes the false error noise from the rest of the file.
For example,
<!-- Global variables in runtime scope, but not lexical scope of this file. Helps to eliminate false positives in Oxygen. Prefixed by "local-".
-->
If there are better ways to address this issue, let me know.
Thanks.
Is there a switch of some type to tell oXygen to look within a directory structure to see if the variable is defined and to not show it as an error.
I don't like globals in general, but this is not my code base and I'm new to XSL. For now, I've been equating a global variable within my files to its global equivalent so that the error that oXygen reports is at the top of the file where I expect it to be. This removes the false error noise from the rest of the file.
For example,
<!-- Global variables in runtime scope, but not lexical scope of this file. Helps to eliminate false positives in Oxygen. Prefixed by "local-".
-->
Code: Select all
<xsl:variable name="local-base-font-family">
<xsl:value-of select="$base-font-family"/>
</xsl:variable>
Thanks.