/** * Get the global variable or parameter with a given name (taking * precedence rules into account). This will only return global variables * declared in the same package where they are used. * * @param qName name of the global variable or parameter * @return the variable declaration, or null if it does not exist */ public SourceBinding getGlobalVariableBinding(StructuredQName qName) { ComponentDeclaration decl = globalVariableIndex.get(qName); return decl == null ? null : ((XSLGlobalVariable) decl.getSourceElement()).getSourceBinding(); }
/** * Get the global variable or parameter with a given name (taking * precedence rules into account). This will only return global variables * declared in the same package where they are used. * * @param qName name of the global variable or parameter * @return the variable declaration, or null if it does not exist */ public SourceBinding getGlobalVariableBinding(StructuredQName qName) { ComponentDeclaration decl = globalVariableIndex.get(qName); return decl == null ? null : ((XSLGlobalVariable) decl.getSourceElement()).getSourceBinding(); }
public void checkCompatibility(Component component) { SequenceType st1 = getSourceBinding().getDeclaredType(); if (st1 == null) { st1 = SequenceType.ANY_SEQUENCE; } GlobalVariable other = (GlobalVariable) component.getActor(); TypeHierarchy th = component.getDeclaringPackage().getConfiguration().getTypeHierarchy(); int relation = th.sequenceTypeRelationship(st1, other.getRequiredType()); if (relation != TypeHierarchy.SAME_TYPE) { compileError( "The declared type of the overriding variable $" + getVariableQName().getDisplayName() + " is different from that of the overridden variable", "XTSE3070"); } }
public void checkCompatibility(Component component) { SequenceType st1 = getSourceBinding().getDeclaredType(); if (st1 == null) { st1 = SequenceType.ANY_SEQUENCE; } GlobalVariable other = (GlobalVariable) component.getActor(); TypeHierarchy th = component.getDeclaringPackage().getConfiguration().getTypeHierarchy(); int relation = th.sequenceTypeRelationship(st1, other.getRequiredType()); if (relation != TypeHierarchy.SAME_TYPE) { compileError( "The declared type of the overriding variable $" + getVariableQName().getDisplayName() + " is different from that of the overridden variable", "XTSE3070"); } }
StructuredQName qName = varDecl.getSourceBinding().getVariableQName(); GlobalVariable compiledVariable = (GlobalVariable) varDecl.getActor(); Component declaringComponent = compiledVariable.getDeclaringComponent();
StructuredQName qName = varDecl.getSourceBinding().getVariableQName(); GlobalVariable compiledVariable = (GlobalVariable) varDecl.getActor(); Component declaringComponent = compiledVariable.getDeclaringComponent();