/** * Bind a variable used in this element to the compiled form of the XSLVariable element in which it is * declared * * @param qName The name of the variable * @return the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable, * or null if no declaration of the variable can be found */ public SourceBinding bindVariable(StructuredQName qName) { SourceBinding decl = bindLocalVariable(qName); if (decl != null) { return decl; } // Now check for a global variable // we rely on the search following the order of decreasing import precedence. SourceBinding binding = getPrincipalStylesheetModule().getGlobalVariableBinding(qName); if (binding == null || Navigator.isAncestorOrSelf(binding.getSourceElement(), this)) { // test case variable-0118 return null; } else { return binding; } }
/** * Bind a variable used in this element to the compiled form of the XSLVariable element in which it is * declared * * @param qName The name of the variable * @return the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable, * or null if no declaration of the variable can be found */ public SourceBinding bindVariable(StructuredQName qName) { SourceBinding decl = bindLocalVariable(qName); if (decl != null) { return decl; } // Now check for a global variable // we rely on the search following the order of decreasing import precedence. SourceBinding binding = getPrincipalStylesheetModule().getGlobalVariableBinding(qName); if (binding == null || Navigator.isAncestorOrSelf(binding.getSourceElement(), this)) { // test case variable-0118 return null; } else { return binding; } }
if (binding != null && !(binding.getSourceElement() instanceof XSLGlobalParam)) { found = true; GlobalVariable var = ((XSLGlobalVariable) binding.getSourceElement()).getCompiledVariable(); Visibility declared = var.getDeclaredVisibility(); checkCompatibility(var.getSymbolicName(), declared, getVisibility());
if (binding != null && !(binding.getSourceElement() instanceof XSLGlobalParam)) { found = true; GlobalVariable var = ((XSLGlobalVariable) binding.getSourceElement()).getCompiledVariable(); Visibility declared = var.getDeclaredVisibility(); checkCompatibility(var.getSymbolicName(), declared, getVisibility());
var = new GlobalVariableReference(qName); GlobalVariable compiledVar = ((XSLGlobalVariable) sourceBinding.getSourceElement()).getCompiledVariable(); if (compiledVar != null && element.getCompilation().getCompilerInfo().isJustInTimeCompilation()) { var.fixup(compiledVar);
var = new GlobalVariableReference(qName); GlobalVariable compiledVar = ((XSLGlobalVariable) sourceBinding.getSourceElement()).getCompiledVariable(); if (compiledVar != null && element.getCompilation().getCompilerInfo().isJustInTimeCompilation()) { var.fixup(compiledVar);