Package net.sf.saxon.instruct
Class WithParam
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.instruct.Instruction
net.sf.saxon.instruct.GeneralVariable
net.sf.saxon.instruct.WithParam
- All Implemented Interfaces:
Serializable,SourceLocator,LocationProvider,SaxonLocator,Binding,EvaluableItem,SequenceIterable,TailCallReturner,InstructionInfo,Locator
An instruction derived from a xsl:with-param element in the stylesheet.
- See Also:
-
Field Summary
Fields inherited from class net.sf.saxon.instruct.GeneralVariable
evaluationMode, referenceCount, slotNumber, variableQNameFields inherited from class net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, staticProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisplayExpressions(WithParam[] params, ExpressionPresenter out) DIsplay the parameter expressionsevaluateVariable(XPathContext context) Evaluate the variable (method exists only to satisfy the interface)intGet the name of this instruction (that is xsl:variable, xsl:param etc) for diagnosticsintGet the parameter id, which is essentially an alias for the parameter name, unique within a stylesheetstatic voidgetXPathExpressions(WithParam[] params, List list) Get the XPath expressions used in an array of WithParam parameters (add them to the supplied list)static voidoptimize(ExpressionVisitor visitor, WithParam[] params, ItemType contextItemType) processLeavingTail(XPathContext context) ProcessLeavingTail: called to do the real work of this instruction.static voidpromoteParams(WithParam[] params, PromotionOffer offer) Promote the expressions in a set of with-param elements.static booleanreplaceXPathExpression(WithParam[] params, Expression original, Expression replacement) Replace a subexpressionvoidsetParameterId(int id) Allocate a number which is essentially an alias for the parameter name, unique within a stylesheetstatic voidsimplify(WithParam[] params, ExpressionVisitor visitor) static voidtypeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType) Methods inherited from class net.sf.saxon.instruct.GeneralVariable
copy, evaluateItem, explain, getCardinality, getEvaluationMode, getItemType, getLocalSlotNumber, getRequiredType, getSelectExpression, getSelectValue, getSlotNumber, getVariableQName, init, isAssignable, isGlobal, isImplicitlyRequiredParam, isRequiredParam, isTunnelParam, iterate, iterateSubExpressions, optimize, promoteInst, replaceSubExpression, setAssignable, setImplicitlyRequiredParam, setReferenceCount, setRequiredParam, setRequiredType, setSelectExpression, setSlotNumber, setTunnel, setVariableQName, simplify, typeCheckMethods inherited from class net.sf.saxon.instruct.Instruction
assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, createsNewNodes, dynamicError, evaluateAsString, getConstructType, getImplementationMethod, getSourceLocator, isXSLT, process, promoteMethods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, display, doPromotion, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, findParentOf, getColumnNumber, getColumnNumber, getContainer, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isUpdatingExpression, iterateEvents, markTailFunctionCalls, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, toString, typeErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.xml.transform.SourceLocator
getColumnNumber, getLineNumber, getPublicId, getSystemId
-
Constructor Details
-
WithParam
public WithParam()
-
-
Method Details
-
setParameterId
public void setParameterId(int id) Allocate a number which is essentially an alias for the parameter name, unique within a stylesheet- Parameters:
id- the parameter id
-
getParameterId
public int getParameterId()Get the parameter id, which is essentially an alias for the parameter name, unique within a stylesheet- Returns:
- the parameter id
-
getInstructionNameCode
public int getInstructionNameCode()Description copied from class:GeneralVariableGet the name of this instruction (that is xsl:variable, xsl:param etc) for diagnostics- Overrides:
getInstructionNameCodein classGeneralVariable- Returns:
- the name of this instruction, as a name pool name code
-
processLeavingTail
Description copied from class:InstructionProcessLeavingTail: called to do the real work of this instruction. This method must be implemented in each subclass. The results of the instruction are written to the current Receiver, which can be obtained via the Controller.- Specified by:
processLeavingTailin interfaceTailCallReturner- Specified by:
processLeavingTailin 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
-
simplify
- Throws:
XPathException
-
typeCheck
public static void typeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType) throws XPathException - Throws:
XPathException
-
optimize
public static void optimize(ExpressionVisitor visitor, WithParam[] params, ItemType contextItemType) throws XPathException - Throws:
XPathException
-
promoteParams
Promote the expressions in a set of with-param elements. This is a convenience method for use by subclasses.- Throws:
XPathException
-
getXPathExpressions
Get the XPath expressions used in an array of WithParam parameters (add them to the supplied list) -
displayExpressions
DIsplay the parameter expressions -
replaceXPathExpression
public static boolean replaceXPathExpression(WithParam[] params, Expression original, Expression replacement) Replace a subexpression -
evaluateVariable
Evaluate the variable (method exists only to satisfy the interface)- Parameters:
context- the XPath dynamic evaluation context- Returns:
- the result of evaluating the variable
- Throws:
XPathException
-