Package net.sf.saxon.style
Class XSLVariableDeclaration
java.lang.Object
net.sf.saxon.tree.linked.NodeImpl
net.sf.saxon.tree.linked.ParentNodeImpl
net.sf.saxon.tree.linked.ElementImpl
net.sf.saxon.style.StyleElement
net.sf.saxon.style.XSLGeneralVariable
net.sf.saxon.style.XSLVariableDeclaration
- All Implemented Interfaces:
Serializable,Source,SourceLocator,LocationProvider,SaxonLocator,PullEvent,Container,VariableDeclaration,FingerprintedNode,Item<NodeInfo>,MutableNodeInfo,NamespaceResolver,NodeInfo,ValueRepresentation<NodeInfo>,StylesheetProcedure,InstructionInfo,SiblingCountingNode,Locator
- Direct Known Subclasses:
XSLParam,XSLVariable
public abstract class XSLVariableDeclaration
extends XSLGeneralVariable
implements VariableDeclaration, StylesheetProcedure
Generic class for xsl:variable and xsl:param elements.
- See Also:
-
Field Summary
FieldsFields inherited from class net.sf.saxon.style.XSLGeneralVariable
assignable, compiledVariable, constantText, global, implicitlyRequiredParam, redundant, requiredParam, requiredType, select, slotManager, tunnelFields inherited from class net.sf.saxon.style.StyleElement
ACTION_COMPILE, ACTION_FIXUP, ACTION_OPTIMIZE, ACTION_PROCESS_ATTRIBUTES, ACTION_TYPECHECK, ACTION_VALIDATE, actionsCompleted, defaultCollationName, defaultXPathNamespace, extensionNamespaces, REPORT_ALWAYS, REPORT_IF_INSTANTIATED, REPORT_UNLESS_FALLBACK_AVAILABLE, REPORT_UNLESS_FORWARDS_COMPATIBLE, reportingCircumstances, staticContext, validationError, version, YES_NOFields inherited from class net.sf.saxon.tree.linked.NodeImpl
NODE_LETTERFields inherited from interface net.sf.saxon.om.NodeInfo
ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACESFields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfixupBinding(Binding binding) Notify all variable references of the Binding instructionvoidNotify all references to this variable of the data typeGet the compiled variableabstract SequenceTypeGet the static type of the variable.Get the SlotManager associated with this stylesheet construct.intGet the slot number allocated to this variable (its position in the stackframe)protected voidindex(Declaration decl, PrincipalStylesheetModule top) Method supplied by declaration elements to add themselves to a stylesheet-level indexbooleanAsk whether this node is a declaration, that is, a permitted child of xsl:stylesheet (including xsl:include and xsl:import).booleanDetermine whether this node is an instruction.voidoptimize(Declaration declaration) Optimize the stylesheet constructvoidMethod called by VariableReference to register the variable reference for subsequent fixupprotected voidSet the number of references to this variable.voidsetSlotNumber(int slot) Allocate a slot number to this variablevoidvalidate(Declaration decl) Check that the variable is not already declared, and allocate a slot numberMethods inherited from class net.sf.saxon.style.XSLGeneralVariable
allowsAsAttribute, allowsRequired, allowsTunnelAttribute, allowsValue, checkAgainstRequiredType, getConstructType, getReturnedItemType, getVariableDisplayName, getVariableQName, initializeBinding, isAssignable, isGlobal, isRequiredParam, isTunnelParam, mayContainSequenceConstructor, postValidate, prepareAttributes, setRedundantMethods inherited from class net.sf.saxon.style.StyleElement
allocateLocationId, allocatePatternSlots, allocateSlots, bindLocalVariable, bindVariable, checkAttributeValue, checkEmpty, checkSortComesFirst, checkTopLevel, checkUnknownAttribute, compile, compileDeclaration, compileError, compileError, compileError, compileError, compileSequenceConstructor, compileWarning, compileWarning, definesExcludedNamespace, definesExtensionElement, fallbackProcessing, forwardsCompatibleModeIsEnabled, getAttributeSets, getAttributeValue, getColumnNumber, getCommonChildItemType, getContainerGranularity, getContainingSlotManager, getContainingStylesheet, getDefaultCollationName, getDefaultXPathNamespace, getEffectiveVersion, getExecutable, getHostLanguage, getLastChildInstruction, getLineNumber, getLocationProvider, getNamespaceResolver, getObjectName, getPreparedStylesheet, getPrincipalStylesheetModule, getProcessorVersion, getProperties, getProperty, getSchemaType, getStaticContext, getSystemId, getTypeAnnotation, getWithParamInstructions, isActionCompleted, isExcludedNamespace, isExplaining, isExtensionNamespace, isPermittedChild, issueWarning, issueWarning, isTopLevel, isXslt30Processor, makeAttributeValueTemplate, makeExpression, makeExpressionVisitor, makeNamespaceContext, makePattern, makeQName, makeSequenceType, makeSortKeys, makeTraceInstruction, markTailCalls, mayContainFallback, mayContainParam, processAllAttributes, processAttributes, processDefaultCollationAttribute, processDefaultXPathNamespaceAttribute, processExcludedNamespaces, processExtensionElementAttribute, processStandardAttributes, processVersionAttribute, reportAbsence, seesAvuncularVariables, setActionCompleted, setObjectName, setValidationError, substituteFor, typeCheck, typeCheck, undeclaredNamespaceError, validateChildren, validateSubtree, xPath10ModeIsEnabledMethods inherited from class net.sf.saxon.tree.linked.ElementImpl
addAttribute, addNamespace, copy, delete, fixupInsertedNamespaces, generateId, getAttributeList, getAttributeValue, getAttributeValue, getBaseURI, getColumnNumber, getDeclaredNamespaces, getDocumentRoot, getLineNumber, getNameCode, getNamespaceList, getNodeKind, getPrefixForURI, getRoot, getSchemaType, getSystemId, getTypeAnnotation, getURIForPrefix, gsetAttributeCollection, initialise, isId, isNilled, iteratePrefixes, removeAttribute, removeTypeAnnotation, rename, replaceStringValue, setAttributeList, setLocation, setNameCode, setNamespaceDeclarations, setNamespaceList, setSystemId, setTypeAnnotationMethods inherited from class net.sf.saxon.tree.linked.ParentNodeImpl
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getRawSequenceNumber, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, insertChildrenAt, removeChild, replaceChildrenAt, setChildren, setRawSequenceNumberMethods inherited from class net.sf.saxon.tree.linked.NodeImpl
atomize, compareOrder, equals, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getRawParent, getSiblingPosition, getTypedValue, getURI, insertSiblings, isDeleted, isIdref, isSameNodeInfo, iterateAxis, iterateAxis, newBuilder, replace, setRawParent, setSiblingPositionMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.InstructionInfo
getLineNumber, getSystemIdMethods inherited from interface org.xml.sax.Locator
getColumnNumber, getPublicIdMethods inherited from interface javax.xml.transform.SourceLocator
getColumnNumber, getLineNumber, getPublicId, getSystemIdMethods inherited from interface net.sf.saxon.expr.VariableDeclaration
getVariableQName
-
Field Details
-
references
-
-
Constructor Details
-
XSLVariableDeclaration
public XSLVariableDeclaration()
-
-
Method Details
-
isDeclaration
public boolean isDeclaration()Ask whether this node is a declaration, that is, a permitted child of xsl:stylesheet (including xsl:include and xsl:import).- Overrides:
isDeclarationin classStyleElement- Returns:
- true for this element
-
getSlotManager
Get the SlotManager associated with this stylesheet construct. The SlotManager contains the information needed to manage the local stack frames used by run-time instances of the code.- Specified by:
getSlotManagerin interfaceStylesheetProcedure- Returns:
- the associated SlotManager object
-
getSlotNumber
public int getSlotNumber()Get the slot number allocated to this variable (its position in the stackframe)- Returns:
- the allocated slot number
-
setSlotNumber
public void setSlotNumber(int slot) Allocate a slot number to this variable- Parameters:
slot- the position of the variable on the local stack frame
-
getRequiredType
Get the static type of the variable.- Returns:
- the static type declared for the variable
-
registerReference
Method called by VariableReference to register the variable reference for subsequent fixup- Specified by:
registerReferencein interfaceVariableDeclaration- Parameters:
ref- the variable reference
-
isInstruction
public boolean isInstruction()Determine whether this node is an instruction.- Overrides:
isInstructionin classStyleElement- Returns:
- true - it is an instruction (well, it can be, anyway)
-
fixupReferences
Notify all references to this variable of the data type- Overrides:
fixupReferencesin classStyleElement- Throws:
XPathException- if any references cannot be fixed up.
-
validate
Check that the variable is not already declared, and allocate a slot number- Overrides:
validatein classXSLGeneralVariable- Parameters:
decl-- Throws:
XPathException- if any error is found during validation
-
fixupBinding
Notify all variable references of the Binding instruction- Parameters:
binding- the Binding that represents this variable declaration in the executable code tree
-
setReferenceCount
Set the number of references to this variable. This code is invoked only for a global variable, and only if there is at least one reference.- Overrides:
setReferenceCountin classXSLGeneralVariable- Parameters:
var- the variable
-
index
Description copied from class:StyleElementMethod supplied by declaration elements to add themselves to a stylesheet-level index- Overrides:
indexin classStyleElement- Parameters:
decl- the Declaration being indexed. (This corresponds to the StyleElement object except in cases where one module is imported several times with different precedence.)top- the outermost XSLStylesheet element- Throws:
XPathException- if any error is encountered
-
optimize
Optimize the stylesheet construct- Specified by:
optimizein interfaceStylesheetProcedure- Parameters:
declaration-- Throws:
XPathException
-
getCompiledVariable
Get the compiled variable- Returns:
- the compiled variable if it has been compiled, or null otherwise
-