public abstract class ElementCreator extends ParentNodeConstructor
Modifier and Type | Field and Description |
---|---|
protected boolean |
inheritNamespacesFromParent
The inheritNamespacesFromParent flag indicates that this element should inherit the namespaces of its
parent element in the result tree.
|
protected boolean |
inheritNamespacesToChildren
The inheritNamespacesToChildren flag indicates that the namespace nodes on the element created by this instruction
are to be inherited (copied) on the children of this element.
|
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 |
---|
ElementCreator()
Construct an ElementCreator.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkContentSequence(StaticContext env)
Check statically whether the content of the element creates attributes or namespaces
after creating any child nodes
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
Item |
evaluateItem(XPathContext context)
Evaluate the constructor, returning the constructed element node.
|
protected void |
exportValidationAndType(ExpressionPresenter out) |
NamespaceBinding[] |
getActiveNamespaces()
Callback to get a list of the intrinsic namespaces that need to be generated for the element.
|
int |
getCardinality()
Determine the static cardinality of the expression.
|
abstract NodeName |
getElementName(XPathContext context,
NodeInfo copiedNode)
Determine (at run-time) the name code of the element being constructed
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
protected String |
getInheritanceFlags() |
ItemType |
getItemType()
Get the item type of the value returned by this instruction
|
abstract String |
getNewBaseURI(XPathContext context,
NodeInfo copiedNode)
Get the base URI for the element being constructed
|
StreamingAdjunct |
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression
|
boolean |
isInheritNamespacesFromParent()
Ask whether this element inherits namespaces from its parent.
|
boolean |
isInheritNamespacesToChildren()
Ask whether the inherit namespaces flag is set
|
EventIterator |
iterateEvents(XPathContext context)
Deliver the result of the expression as a sequence of events.
|
protected EventIterator |
iterateEvents(XPathContext context,
NodeInfo copiedNode) |
abstract void |
outputNamespaceNodes(XPathContext context,
Receiver receiver,
NodeName nameCode,
NodeInfo copiedNode)
Callback to output namespace nodes for the new element.
|
TailCall |
processLeavingTail(XPathContext context)
Evaluate the instruction to produce a new element node.
|
TailCall |
processLeavingTail(XPathContext context,
NodeInfo copiedNode)
Evaluate the instruction to produce a new element node.
|
void |
setInheritanceFlags(String flags) |
void |
setInheritNamespacesFromParent(boolean inherit)
Say whether this element causes inherits namespaces from its parent.
|
void |
setInheritNamespacesToChildren(boolean inherit)
Say whether this element causes its children to inherit namespaces
|
void |
suppressValidation(int parentValidationMode)
Suppress validation on contained element constructors, on the grounds that the parent element
is already performing validation.
|
addToPathMap, computeCardinality, createsNewNodes, getContentExpression, getContentOperand, getSchemaType, getValidationAction, getValidationOptions, isLazyConstruction, isPreservingTypes, optimize, promoteChildren, setBaseURI, setContentExpression, setLazyConstruction, setNoNeedToStrip, setValidationAction, typeCheck
assembleParams, assembleTunnelParams, dynamicError, evaluateAsString, getConstructType, getExpressionName, getInstructionName, getInstructionNameCode, getNetCost, getSourceLocator, isXSLT, iterate, main, operands, process, toStreamingPattern
adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, copy, doPromotion, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, export, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExpressionCompiler, 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, simplify, simplifyChildren, staticTypeCheck, toPattern, toShortString, toString, typeCheckChildren, typeError, unordered
protected boolean inheritNamespacesToChildren
protected boolean inheritNamespacesFromParent
public ElementCreator()
public ItemType getItemType()
getItemType
in class Instruction
public int getCardinality()
Expression
getCardinality
in class ParentNodeConstructor
public void setInheritNamespacesToChildren(boolean inherit)
inherit
- true if namespaces are to be inherited by the childrenpublic boolean isInheritNamespacesToChildren()
public void setInheritNamespacesFromParent(boolean inherit)
inherit
- true if namespaces are to be inherited from the parentpublic boolean isInheritNamespacesFromParent()
public int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public void suppressValidation(int parentValidationMode)
suppressValidation
in class Expression
parentValidationMode
- the kind of validation being performed on the parent expressionprotected void checkContentSequence(StaticContext env) throws XPathException
checkContentSequence
in class ParentNodeConstructor
env
- the static contextXPathException
public abstract NodeName getElementName(XPathContext context, NodeInfo copiedNode) throws XPathException
context
- the XPath dynamic evaluation contextcopiedNode
- for the benefit of xsl:copy, the node being copied; otherwise nullXPathException
- if a failure occurspublic abstract String getNewBaseURI(XPathContext context, NodeInfo copiedNode)
context
- the XPath dynamic evaluation contextcopiedNode
- the node being copied (for xsl:copy), otherwise nullpublic abstract void outputNamespaceNodes(XPathContext context, Receiver receiver, NodeName nameCode, NodeInfo copiedNode) throws XPathException
context
- The execution contextreceiver
- the Receiver where the namespace nodes are to be writtennameCode
- the name code of the element being createdcopiedNode
- the node being copied (for xsl:copy) or null otherwiseXPathException
- if a dynamic error occurspublic NamespaceBinding[] getActiveNamespaces() throws XPathException
XPathException
- if an error occurspublic int getImplementationMethod()
getImplementationMethod
in class Instruction
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public EventIterator iterateEvents(XPathContext context) throws XPathException
Expression
The 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 Expression
context
- The dynamic evaluation contextXPathException
- if a dynamic error occurs during expression evaluationprotected EventIterator iterateEvents(XPathContext context, NodeInfo copiedNode) throws XPathException
XPathException
public TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
context
- XPath dynamic evaluation contextXPathException
public final TailCall processLeavingTail(XPathContext context, NodeInfo copiedNode) throws XPathException
context
- XPath dynamic evaluation contextcopiedNode
- null except in the case of xsl:copy, when it is the node being copied; otherwise nullXPathException
- if a dynamic error occurspublic Item 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
expressionprotected void exportValidationAndType(ExpressionPresenter out)
protected String getInheritanceFlags()
public void setInheritanceFlags(String flags)
public StreamingAdjunct getStreamingAdjunct()
getStreamingAdjunct
in class Expression
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.