net.sf.saxon.instruct

Class DocumentInstr

public class DocumentInstr extends ParentNodeConstructor

An instruction to create a document node. This doesn't correspond directly to any XSLT instruction. It is used to support the document node constructor expression in XQuery, and is used as a sub-instruction within an xsl:variable that constructs a temporary tree.

Conceptually it represents an XSLT instruction xsl:document-node, with no attributes, whose content is a complex content constructor for the children of the document node.

Constructor Summary
DocumentInstr(boolean textOnly, String constantText, String baseURI)
Method Summary
voiddisplay(int level, NamePool pool, PrintStream out)
Display this instruction as an expression, for diagnostics
ItemevaluateItem(XPathContext context)
Evaluate as an expression.
intgetImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
intgetInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes (the string "document-constructor")
ItemTypegetItemType(TypeHierarchy th)
TailCallprocessLeavingTail(XPathContext context)
voidsetValidationAction(int action)
Set the validation action
Expressionsimplify(StaticContext env)
Simplify an expression.
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)

Constructor Detail

DocumentInstr

public DocumentInstr(boolean textOnly, String constantText, String baseURI)

Method Detail

display

public void display(int level, NamePool pool, PrintStream out)
Display this instruction as an expression, for diagnostics

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate as an expression.

getImplementationMethod

public int getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is prefered. For instructions this is the process() method.

getInstructionNameCode

public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes (the string "document-constructor")

getItemType

public ItemType getItemType(TypeHierarchy th)

processLeavingTail

public TailCall processLeavingTail(XPathContext context)

setValidationAction

public void setValidationAction(int action)
Set the validation action

simplify

public Expression simplify(StaticContext env)
Simplify an expression. This performs any static optimization (by rewriting the expression as a different expression). The default implementation does nothing.

Returns: the simplified expression

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

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)