net.sf.saxon.instruct

Class Message

Implemented Interfaces:
SourceLocator, EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator, TailCallReturner

public class Message
extends Instruction

An xsl:message element in the stylesheet.

Field Summary

Fields inherited from class net.sf.saxon.expr.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Constructor Summary

Message(Expression select, Expression terminate)
Create an xsl:message instruction

Method Summary

Expression
copy()
Copy an expression.
boolean
createsNewNodes()
Determine whether this instruction creates new nodes.
void
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
int
getCardinality()
Get the static cardinality.
int
getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
ItemType
getItemType(TypeHierarchy th)
Get the item type.
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)
Expression
optimize(ExpressionVisitor visitor, ItemType contextItemType)
TailCall
processLeavingTail(XPathContext context)
protected void
promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.
boolean
replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression
Expression
simplify(ExpressionVisitor visitor)
Simplify an expression.
Expression
typeCheck(ExpressionVisitor visitor, ItemType contextItemType)

Methods inherited from class net.sf.saxon.instruct.Instruction

assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, createsNewNodes, dynamicError, evaluateAsString, evaluateItem, getImplementationMethod, getInstructionInfo, getInstructionNameCode, getItemType, getSourceLocator, isXSLT, iterate, process, processLeavingTail, promote, promoteInst, simplify

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Constructor Details

Message

public Message(Expression select,
               Expression terminate)
Create an xsl:message instruction
Parameters:
select - the expression that constructs the message (composite of the select attribute and the contained sequence constructor)
terminate - expression that calculates terminate = yes or no.

Method Details

copy

public Expression copy()
Copy an expression. This makes a deep copy.
Overrides:
copy in interface Expression
Returns:
the copy of the original expression

createsNewNodes

public final boolean createsNewNodes()
Determine whether this instruction creates new nodes. This implementation returns true.
Overrides:
createsNewNodes in interface Instruction

explain

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

getCardinality

public int getCardinality()
Get the static cardinality. To avoid spurious compile-time type errors, we falsely declare that the instruction returns zero or one items - this is always acceptable
Overrides:
getCardinality in interface Expression
Returns:
zero or one

getInstructionNameCode

public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
Overrides:
getInstructionNameCode in interface Instruction

getItemType

public ItemType getItemType(TypeHierarchy th)
Get the item type. To avoid spurious compile-time type errors, we falsely declare that the instruction can return anything
Overrides:
getItemType in interface Instruction
Parameters:
th - the type hierarchy cache
Returns:
AnyItemType

iterateSubExpressions

public 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)
Overrides:
iterateSubExpressions in interface Expression

optimize

public Expression optimize(ExpressionVisitor visitor,
                           ItemType contextItemType)
            throws XPathException
Overrides:
optimize in interface Expression

processLeavingTail

public TailCall processLeavingTail(XPathContext context)
            throws XPathException
Specified by:
processLeavingTail in interface TailCallReturner
Overrides:
processLeavingTail in interface Instruction

promoteInst

protected void promoteInst(PromotionOffer offer)
            throws XPathException
Handle promotion offers, that is, non-local tree rewrites.
Overrides:
promoteInst in interface Instruction
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
Overrides:
replaceSubExpression in interface Expression
Parameters:
original - the original subexpression
replacement - the replacement subexpression
Returns:
true if the original subexpression is found

simplify

public Expression simplify(ExpressionVisitor visitor)
            throws XPathException
Simplify an expression. This performs any static optimization (by rewriting the expression as a different expression). The default implementation does nothing.
Overrides:
simplify in interface Instruction
Parameters:
visitor - an expression visitor
Returns:
the simplified expression
Throws:
XPathException - if an error is discovered during expression rewriting

typeCheck

public Expression typeCheck(ExpressionVisitor visitor,
                            ItemType contextItemType)
            throws XPathException
Overrides:
typeCheck in interface Expression