Package net.sf.saxon.instruct
Class LocalParam
- java.lang.Object
-
- net.sf.saxon.expr.ComputedExpression
-
- net.sf.saxon.instruct.Instruction
-
- net.sf.saxon.instruct.GeneralVariable
-
- net.sf.saxon.instruct.LocalParam
-
- All Implemented Interfaces:
java.io.Serializable
,javax.xml.transform.SourceLocator
,Binding
,Container
,Expression
,TailCallReturner
,InstructionInfoProvider
public final class LocalParam extends GeneralVariable
The compiled form of an xsl:param element in the stylesheet or an external variable in a Query.
The xsl:param element in XSLT has mandatory attribute name and optional attribute select. It can also be specified as required="yes" or required="no". In standard XQuery external variables are always required, and no default value can be specified; but Saxon provides an extension pragma that allows a query to specify a default.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.instruct.GeneralVariable
evaluationMode, nameCode, referenceCount, requiredType, select, slotNumber
-
Fields inherited from class net.sf.saxon.expr.ComputedExpression
locationId, staticProperties
-
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
-
-
Constructor Summary
Constructors Constructor Description LocalParam()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueRepresentation
evaluateVariable(XPathContext c)
Evaluate the variableint
getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposesjava.util.Iterator
iterateSubExpressions()
Get all the XPath expressions associated with this instruction (in XSLT terms, the expression present on attributes of the instruction, as distinct from the child instructions in a sequence construction)TailCall
processLeavingTail(XPathContext context)
Process the local parameter declarationboolean
replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpressionvoid
setConversion(Expression convertor)
Define a conversion that is to be applied to the supplied parameter value.-
Methods inherited from class net.sf.saxon.instruct.GeneralVariable
display, evaluateItem, getCardinality, getItemType, getLocalSlotNumber, getNameCode, getRequiredType, getSelectExpression, getSelectValue, getSlotNumber, getVariableFingerprint, getVariableName, init, isAssignable, isGlobal, isImplicitlyRequiredParam, isRequiredParam, isTunnelParam, iterate, optimize, promoteInst, setAssignable, setImplicitlyRequiredParam, setNameCode, setReferenceCount, setRequiredParam, setRequiredType, setSelectExpression, setSlotNumber, setTunnel, setVariableName, simplify, typeCheck
-
Methods inherited from class net.sf.saxon.instruct.Instruction
appendItem, assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, createsNewNodes, dynamicError, evaluateAsString, getImplementationMethod, getInstructionInfo, getSourceLocator, isXSLT, process, promote
-
Methods inherited from class net.sf.saxon.expr.ComputedExpression
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeError
-
-
-
-
Method Detail
-
setConversion
public void setConversion(Expression convertor)
Define a conversion that is to be applied to the supplied parameter value.- Parameters:
convertor
-
-
getInstructionNameCode
public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes- Overrides:
getInstructionNameCode
in classGeneralVariable
-
iterateSubExpressions
public java.util.Iterator iterateSubExpressions()
Get all the XPath expressions associated with this instruction (in XSLT terms, the expression present on attributes of the instruction, as distinct from the child instructions in a sequence construction)- Specified by:
iterateSubExpressions
in interfaceExpression
- Overrides:
iterateSubExpressions
in classGeneralVariable
- Returns:
- an iterator containing the sub-expressions of this expression
-
replaceSubExpression
public boolean replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression- Specified by:
replaceSubExpression
in interfaceContainer
- Overrides:
replaceSubExpression
in classGeneralVariable
- Parameters:
original
- the original subexpressionreplacement
- the replacement subexpression- Returns:
- true if the original subexpression is found
-
processLeavingTail
public TailCall processLeavingTail(XPathContext context) throws XPathException
Process the local parameter declaration- Specified by:
processLeavingTail
in interfaceTailCallReturner
- Specified by:
processLeavingTail
in classInstruction
- Parameters:
context
- The dynamic context of the transformation, giving access to the current node, the current variables, etc.- Returns:
- null if the instruction has completed execution; or a TailCall indicating a function call or template call that is delegated to the caller, to be made after the stack has been unwound so as to save stack space.
- Throws:
XPathException
-
evaluateVariable
public ValueRepresentation evaluateVariable(XPathContext c)
Evaluate the variable
-
-