net.sf.saxon.instruct

Class Doctype

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

public class Doctype
extends Instruction

A saxon:doctype 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

Doctype(Expression content)

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
getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
Iterator
iterateSubExpressions()
Get the immediate sub-expressions of this expression.
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

Doctype

public Doctype(Expression content)

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

getInstructionNameCode

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

iterateSubExpressions

public Iterator iterateSubExpressions()
Get the immediate sub-expressions of this expression. Default implementation returns a zero-length array, appropriate for an expression that has no sub-expressions.
Overrides:
iterateSubExpressions in interface Expression
Returns:
an iterator containing the sub-expressions of this 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