/** * For each local parameter definition, fix up all references to the function parameter * @param fn the compiled user function */ private void bindParameterDefinitions(UserFunction fn) { UserFunctionParameter[] params = fn.getParameterDefinitions(); int count = 0; AxisIterator kids = iterateAxis(AxisInfo.CHILD); NodeInfo node; while ((node = kids.next()) != null) { if (node instanceof XSLLocalParam) { UserFunctionParameter param = params[count++]; param.setRequiredType(((XSLLocalParam) node).getRequiredType()); param.setVariableQName(((XSLLocalParam) node).getVariableQName()); param.setSlotNumber(((XSLLocalParam) node).getSlotNumber()); ((XSLLocalParam) node).getSourceBinding().fixupBinding(param); } } }
/** * For each local parameter definition, fix up all references to the function parameter * @param fn the compiled user function */ private void bindParameterDefinitions(UserFunction fn) { UserFunctionParameter[] params = fn.getParameterDefinitions(); int count = 0; AxisIterator kids = iterateAxis(AxisInfo.CHILD); NodeInfo node; while ((node = kids.next()) != null) { if (node instanceof XSLLocalParam) { UserFunctionParameter param = params[count++]; param.setRequiredType(((XSLLocalParam) node).getRequiredType()); param.setVariableQName(((XSLLocalParam) node).getVariableQName()); param.setSlotNumber(((XSLLocalParam) node).getSlotNumber()); ((XSLLocalParam) node).getSourceBinding().fixupBinding(param); } } }
/** * Compile a global xsl:param element: this ensures space is available for local variables declared within * this global variable */ public void compileDeclaration(Compilation compilation, ComponentDeclaration decl) throws XPathException { if (sourceBinding.isStatic()) { super.compileDeclaration(compilation, decl); } else if (!redundant) { sourceBinding.handleSequenceConstructor(compilation, decl); GlobalParam binding = (GlobalParam)compiledVariable; binding.setPackageData(getCompilation().getPackageData()); binding.makeDeclaringComponent(Visibility.PUBLIC, getContainingPackage()); Expression select = sourceBinding.getSelectExpression(); binding.setSelectExpression(select); binding.setVariableQName(sourceBinding.getVariableQName()); initializeBinding(binding); binding.setRequiredType(getRequiredType()); binding.setRequiredParam(sourceBinding.hasProperty(SourceBinding.REQUIRED)); binding.setImplicitlyRequiredParam(sourceBinding.hasProperty(SourceBinding.IMPLICITLY_REQUIRED)); sourceBinding.fixupBinding(binding); //compiledVariable = binding; Component overridden = getOverriddenComponent(); if (overridden != null) { checkCompatibility(overridden); } } }
/** * Compile a global xsl:param element: this ensures space is available for local variables declared within * this global variable */ public void compileDeclaration(Compilation compilation, ComponentDeclaration decl) throws XPathException { if (sourceBinding.isStatic()) { super.compileDeclaration(compilation, decl); } else if (!redundant) { sourceBinding.handleSequenceConstructor(compilation, decl); GlobalParam binding = (GlobalParam)compiledVariable; binding.setPackageData(getCompilation().getPackageData()); binding.makeDeclaringComponent(Visibility.PUBLIC, getContainingPackage()); Expression select = sourceBinding.getSelectExpression(); binding.setSelectExpression(select); binding.setVariableQName(sourceBinding.getVariableQName()); initializeBinding(binding); binding.setRequiredType(getRequiredType()); binding.setRequiredParam(sourceBinding.hasProperty(SourceBinding.REQUIRED)); binding.setImplicitlyRequiredParam(sourceBinding.hasProperty(SourceBinding.IMPLICITLY_REQUIRED)); sourceBinding.fixupBinding(binding); //compiledVariable = binding; Component overridden = getOverriddenComponent(); if (overridden != null) { checkCompatibility(overridden); } } }
inst.setAssignable(isAssignable()); inst.setRequiredType(getRequiredType()); sourceBinding.fixupBinding(inst); compiledVariable = inst;
inst.setAssignable(isAssignable()); inst.setRequiredType(getRequiredType()); sourceBinding.fixupBinding(inst); compiledVariable = inst;
let.setSequence(sourceBinding.getSelectExpression()); let.setAction(tail); sourceBinding.fixupBinding(let); locationId = ((StyleElement) node).allocateLocation(); let.setLocation(locationId);
let.setSequence(sourceBinding.getSelectExpression()); let.setAction(tail); sourceBinding.fixupBinding(let); locationId = ((StyleElement) node).allocateLocation(); let.setLocation(locationId);
binding.setImplicitlyRequiredParam(sourceBinding.hasProperty(SourceBinding.IMPLICITLY_REQUIRED)); binding.setTunnel(sourceBinding.hasProperty(SourceBinding.TUNNEL)); sourceBinding.fixupBinding(binding); return compiledParam = binding;
binding.setImplicitlyRequiredParam(sourceBinding.hasProperty(SourceBinding.IMPLICITLY_REQUIRED)); binding.setTunnel(sourceBinding.hasProperty(SourceBinding.TUNNEL)); sourceBinding.fixupBinding(binding); return compiledParam = binding;