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, preservingTypes
EFFECTIVE_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,
java.lang.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(RebindingMap rebindings)
Copy an expression.
|
NodeInfo |
evaluateItem(XPathContext context)
Evaluate as an item.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
java.lang.CharSequence |
getConstantText()
For a text-only instruction, determine if the text value is fixed and if so return it;
otherwise return null
|
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
|
java.lang.String |
getStreamerName()
Get the (partial) name of a class that supports streaming of this kind of 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.
|
java.lang.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.
|
addToPathMap, allowExtractingCommonSubexpressions, alwaysCreatesNewNodes, computeCardinality, getCardinality, getContentExpression, getContentOperand, getSchemaType, getValidationAction, getValidationOptions, isLazyConstruction, isLocal, isPreservingTypes, mayCreateNewNodes, optimize, setBaseURI, setContentExpression, setLazyConstruction, setNoNeedToStrip, setValidationAction, typeCheck
assembleParams, assembleTunnelParams, dynamicError, evaluateAsString, getConstructType, getExpressionName, getInstructionName, getNetCost, getSourceLocator, isInstruction, isXSLT, iterate, process, someOperandCreatesNewNodes
adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointers
public DocumentInstr(boolean textOnly, java.lang.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 java.lang.Iterable<Operand> operands()
Expression
If 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 Instruction
public int getImplementationMethod()
getImplementationMethod
in class Instruction
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public boolean isTextOnly()
public java.lang.CharSequence getConstantText()
protected void checkContentSequence(StaticContext env) throws XPathException
checkContentSequence
in class ParentNodeConstructor
env
- the static contextXPathException
protected static void checkContentSequence(StaticContext env, Operand content, ParseOptions validationOptions) throws XPathException
XPathException
public int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public Expression getStringValueExpression()
public Expression copy(RebindingMap rebindings)
copy
in class Expression
rebindings
- public ItemType getItemType()
getItemType
in class Instruction
public TailCall processLeavingTail(XPathContext context) throws XPathException
Instruction
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
context
- 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 Instruction
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic int getInstructionNameCode()
getInstructionNameCode
in class Instruction
public void export(ExpressionPresenter out) throws XPathException
export
in interface ExportAgent
export
in class Expression
out
- the expression presenter used to display the structureXPathException
- if the export fails, for example if an expression is found that won't work
in the target environment.public java.lang.String getStreamerName()
getStreamerName
in class Expression
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.