net.sf.saxon.instruct

Class ApplyImports

public class ApplyImports extends Instruction

An xsl:apply-imports element in the stylesheet
Field Summary
WithParam[]actualParams
WithParam[]tunnelParams
Constructor Summary
ApplyImports()
Method Summary
Expressioncopy()
Copy an expression.
booleancreatesNewNodes()
Determine whether this instruction creates new nodes.
voidexplain(ExpressionPresenter out)
Diagnostic print of expression structure.
intgetInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
intgetIntrinsicDependencies()
Iterator<Expression>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)
Expressionoptimize(ExpressionVisitor visitor, ItemType contextItemType)
TailCallprocessLeavingTail(XPathContext context)
protected voidpromoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.
booleanreplaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression
voidsetActualParameters(WithParam[] actualParams, WithParam[] tunnelParams)
Set the actual parameters on the call
Expressionsimplify(ExpressionVisitor visitor)
Simplify an expression.
ExpressiontypeCheck(ExpressionVisitor visitor, ItemType contextItemType)

Field Detail

actualParams

WithParam[] actualParams

tunnelParams

WithParam[] tunnelParams

Constructor Detail

ApplyImports

public ApplyImports()

Method Detail

copy

public Expression copy()
Copy an expression. This makes a deep copy.

Returns: the copy of the original expression

createsNewNodes

public final boolean createsNewNodes()
Determine whether this instruction creates new nodes. This implementation returns true (which is almost invariably the case, so it's not worth doing any further analysis to find out more precisely).

explain

public void explain(ExpressionPresenter out)
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.

getInstructionNameCode

public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes

getIntrinsicDependencies

public int getIntrinsicDependencies()

iterateSubExpressions

public Iterator<Expression> 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)

optimize

public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType)

processLeavingTail

public TailCall processLeavingTail(XPathContext context)

promoteInst

protected void promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.

Parameters: offer The type of rewrite being offered

Throws: XPathException

replaceSubExpression

public boolean replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression

Parameters: original the original subexpression replacement the replacement subexpression

Returns: true if the original subexpression is found

setActualParameters

public void setActualParameters(WithParam[] actualParams, WithParam[] tunnelParams)
Set the actual parameters on the call

simplify

public Expression simplify(ExpressionVisitor visitor)
Simplify an expression. This performs any static optimization (by rewriting the expression as a different expression).

Parameters: visitor an expression visitor

Returns: the simplified expression

Throws: net.sf.saxon.trans.XPathException if an error is discovered during expression rewriting

typeCheck

public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)