net.sf.saxon.instruct

Class Comment

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

public final class Comment
extends SimpleNodeConstructor

An instruction representing an xsl:comment element in the stylesheet.

Field Summary

Fields inherited from class net.sf.saxon.instruct.SimpleNodeConstructor

select

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

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Constructor Summary

Comment()
Construct the instruction

Method Summary

protected String
checkContent(String comment, XPathContext context)
Check the content of the node, and adjust it if necessary
Expression
copy()
Copy an expression.
void
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
int
getCardinality()
int
getInstructionNameCode()
Get the instruction name, for diagnostics and tracing return the string "xsl:comment"
ItemType
getItemType(TypeHierarchy th)
void
localTypeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Method to perform type-checking specific to the kind of instruction
TailCall
processLeavingTail(XPathContext context)
Process this instruction, to output a Comment Node

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

checkContent, computeCardinality, computeSpecialProperties, createsNewNodes, evaluateItem, evaluateNameCode, expandChildren, getSelect, iterate, iterateSubExpressions, localTypeCheck, optimize, promoteInst, replaceSubExpression, setSelect, simplify, typeCheck

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

Comment

public Comment()
Construct the instruction

Method Details

checkContent

protected String checkContent(String comment,
                              XPathContext context)
            throws XPathException
Check the content of the node, and adjust it if necessary
Overrides:
checkContent in interface SimpleNodeConstructor
Parameters:
comment - the supplied content
context - the dynamic context
Returns:
the original content, unless adjustments are needed
Throws:
XPathException - if the content is invalid

copy

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

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()
Overrides:
getCardinality in interface Expression

getInstructionNameCode

public int getInstructionNameCode()
Get the instruction name, for diagnostics and tracing return the string "xsl:comment"
Overrides:
getInstructionNameCode in interface Instruction

getItemType

public ItemType getItemType(TypeHierarchy th)
Overrides:
getItemType in interface Instruction

localTypeCheck

public void localTypeCheck(ExpressionVisitor visitor,
                           ItemType contextItemType)
            throws XPathException
Method to perform type-checking specific to the kind of instruction
Overrides:
localTypeCheck in interface SimpleNodeConstructor
Parameters:
visitor - an expression visitor
contextItemType - the static type of the context item
Throws:
XPathException -

processLeavingTail

public TailCall processLeavingTail(XPathContext context)
            throws XPathException
Process this instruction, to output a Comment Node
Specified by:
processLeavingTail in interface TailCallReturner
Overrides:
processLeavingTail in interface Instruction
Parameters:
context - the dynamic context for this transformation
Returns:
a TailCall representing a call delegated to the caller. Always returns null in this implementation