public class DocumentInstr extends ParentNodeConstructor
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.
contentOp, preservingTypesEFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD| Constructor and Description | 
|---|
DocumentInstr(boolean textOnly,
             String constantText)
Create a document constructor instruction 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
checkContentSequence(StaticContext env)
Check statically that the sequence of child instructions doesn't violate any obvious constraints
 on the content of the node 
 | 
protected static void | 
checkContentSequence(StaticContext env,
                    Operand content,
                    ParseOptions validationOptions)  | 
int | 
computeSpecialProperties()
Get the static properties of this expression (other than its type). 
 | 
Expression | 
copy()
Copy an expression. 
 | 
NodeInfo | 
evaluateItem(XPathContext context)
Evaluate as an item. 
 | 
void | 
export(ExpressionPresenter out)
Diagnostic print of expression structure. 
 | 
CharSequence | 
getConstantText()
For a text-only instruction, determine if the text value is fixed and if so return it;
 otherwise return null 
 | 
ExpressionCompiler | 
getExpressionCompiler()
Return the compiler of the DocumentInstr expression 
 | 
int | 
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). 
 | 
int | 
getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
 (the string "document-constructor") 
 | 
ItemType | 
getItemType()
Get the item type 
 | 
DocumentInstrAdjunct | 
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression 
 | 
Expression | 
getStringValueExpression()
In the case of a text-only instruction (xsl:variable containing a text node or one or more xsl:value-of
 instructions), return an expression that evaluates to the textual content as an instance of xs:untypedAtomic 
 | 
boolean | 
isTextOnly()
Determine whether this is a "text only" document: essentially, an XSLT xsl:variable that contains
 a single text node or xsl:value-of instruction. 
 | 
EventIterator | 
iterateEvents(XPathContext context)
Deliver the result of the expression as a sequence of events. 
 | 
Iterable<Operand> | 
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
 of each expression to its parent expression. 
 | 
TailCall | 
processLeavingTail(XPathContext context)
ProcessLeavingTail: called to do the real work of this instruction. 
 | 
Expression | 
simplify()
Simplify an expression. 
 | 
addToPathMap, computeCardinality, createsNewNodes, getCardinality, getContentExpression, getContentOperand, getSchemaType, getValidationAction, getValidationOptions, isLazyConstruction, isPreservingTypes, optimize, promoteChildren, setBaseURI, setContentExpression, setLazyConstruction, setNoNeedToStrip, setValidationAction, typeCheckassembleParams, assembleTunnelParams, dynamicError, evaluateAsString, getConstructType, getExpressionName, getInstructionName, getNetCost, getSourceLocator, isXSLT, iterate, main, process, toStreamingPatternadoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, getConfiguration, getCost, getDependencies, getEvaluationMethod, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLocation, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, promote, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheckChildren, typeError, unorderedpublic DocumentInstr(boolean textOnly,
             String constantText)
textOnly - true if the content contains text nodes onlyconstantText - if the content contains text nodes only and the text is known at compile time,
                     supplies the textual contentpublic Iterable<Operand> operands()
ExpressionIf the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.
operands in class Instructionpublic int getImplementationMethod()
getImplementationMethod in class InstructionExpression.ITERATE_METHOD or Expression.EVALUATE_METHOD or
         Expression.PROCESS_METHODpublic boolean isTextOnly()
public CharSequence getConstantText()
public Expression simplify() throws XPathException
simplify in class ExpressionXPathException - if an error is discovered during expression rewritingprotected void checkContentSequence(StaticContext env) throws XPathException
checkContentSequence in class ParentNodeConstructorenv - the static contextXPathExceptionprotected static void checkContentSequence(StaticContext env, Operand content, ParseOptions validationOptions) throws XPathException
XPathExceptionpublic int computeSpecialProperties()
computeSpecialProperties in class Instructionpublic Expression getStringValueExpression()
public Expression copy()
copy in class Expressionpublic ItemType getItemType()
getItemType in class Instructionpublic TailCall processLeavingTail(XPathContext context) throws XPathException
InstructionprocessLeavingTail in interface TailCallReturnerprocessLeavingTail in class Instructioncontext - The dynamic context of the transformation, giving access to the current node,
                the current variables, etc.XPathException - if a dynamic error occurs during the evaluation
          of the instructionpublic NodeInfo evaluateItem(XPathContext context) throws XPathException
evaluateItem in class Instructioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
                        expressionpublic EventIterator iterateEvents(XPathContext context) throws XPathException
ExpressionThe events (of class PullEvent) are either complete
 items, or one of startElement, endElement, startDocument, or endDocument, known
 as semi-nodes. The stream of events may also include a nested EventIterator.
 If a start-end pair exists in the sequence, then the events between
 this pair represent the content of the document or element. The content sequence will
 have been processed to the extent that any attribute and namespace nodes in the
 content sequence will have been merged into the startElement event. Namespace fixup
 will have been performed: that is, unique prefixes will have been allocated to element
 and attribute nodes, and all namespaces will be declared by means of a namespace node
 in the startElement event or in an outer startElement forming part of the sequence.
 However, duplicate namespaces may appear in the sequence.
The content of an element or document may include adjacent or zero-length text nodes, atomic values, and nodes represented as nodes rather than broken down into events.
iterateEvents in class Expressioncontext - The dynamic evaluation contextXPathException - if a dynamic error occurs during expression evaluationpublic int getInstructionNameCode()
getInstructionNameCode in class Instructionpublic void export(ExpressionPresenter out)
export in class Expressionout - the expression presenter used to display the structurepublic ExpressionCompiler getExpressionCompiler()
getExpressionCompiler in class Expressionpublic DocumentInstrAdjunct getStreamingAdjunct()
getStreamingAdjunct in class ExpressionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.