net.sf.saxon.instruct
public class CopyOf extends Instruction implements DivisibleInstruction
Constructor Summary | |
---|---|
CopyOf(Expression select, boolean copyNamespaces, int validation, SchemaType schemaType, boolean rejectDuplicateAttributes)
Create an xsl:copy-of instruction (also used in XQuery for implicit copying) |
Method Summary | |
---|---|
Expression | copy()
Copy an expression. |
static void | copyAttribute(NodeInfo source, SchemaType schemaType, int validation, Instruction instruction, XPathContext context, boolean rejectDuplicates)
Method shared by xsl:copy and xsl:copy-of to copy an attribute node |
boolean | createsNewNodes()
Determine whether this instruction creates new nodes.
|
Item | evaluateItem(XPathContext context)
Return the first item if there is one, or null if not |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int | getCardinality() |
int | getDependencies() |
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 diagnostics and tracing |
ItemType | getItemType(TypeHierarchy th) |
SchemaType | getSchemaType()
Get the schema type to be used for validation |
Expression | getSelectExpression()
Get the expression that selects the nodes to be copied |
int | getValidationMode()
Get the validation mode |
boolean | isCopyForUpdate()
Ask whether this instruction is creating a copy for the purpose of updating (XQuery transform expression) |
boolean | isCopyNamespaces()
Determine whether namespaces are to be copied or not |
boolean | isDocumentOrElementRequired()
Test whether this expression requires a document or element node |
SequenceIterator | iterate(XPathContext context) |
Iterator<Expression> | iterateSubExpressions() |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
TailCall | processLeavingTail(XPathContext context)
Process this xsl:copy-of instruction
|
void | processLeft(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the first half of the instruction (for example, to start a new document or element) |
void | processRight(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the right half of the instruction (for example, to end a new document or element) |
protected void | promoteInst(PromotionOffer offer) |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
void | setCopyForUpdate(boolean forUpdate)
Set whether this instruction is creating a copy for the purpose of updating (XQuery transform expression) |
void | setCopyLineNumbers(boolean copy)
Set whether line numbers are to be copied from the source to the result.
|
void | setReadOnce(boolean b)
Set the "saxon:read-once" optimization mode |
void | setRequireDocumentOrElement(boolean requireDocumentOrElement)
For XQuery, the operand (select) must be a single element or document node. |
void | setStaticBaseUri(String base)
Set the static base URI of the xsl:copy-of instruction |
Expression | simplify(ExpressionVisitor visitor) |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
Parameters: select expression that selects the nodes to be copied copyNamespaces true if namespaces are to be copied validation validation mode for the result tree schemaType schema type for validating the result tree rejectDuplicateAttributes true if duplicate attributes are to be rejected (XQuery). False if duplicates are handled by discarding all but the first (XSLT).
Returns: the copy of the original expression
Parameters: source the node to be copied schemaType the simple type against which the value is to be validated, if any validation one of preserve, strip, strict, lax instruction the calling instruction, used for diagnostics context the dynamic context rejectDuplicates true if duplicate attributes with the same name are disallowed (XQuery)
Throws: XPathException
Parameters: context the XPath dynamic context
Returns: the result of evaluating the instruction
Throws: XPathException
Returns: the schema type, or null if not validating against a type
Returns: the select expression
Returns: the validation mode
Returns: true if this copy is being created to support an update
Returns: true if namespaces are to be copied (the default)
Returns: true if this expression requires the value of the argument to be a document or element node, false if there is no such requirement
Parameters: context the dynamic context for the transformation
Returns: null - this implementation of the method never returns a TailCall
Parameters: contextStack state a stack on which the instruction can save state information during the call on processLeft()
Parameters: contextStack state a stack on which the instruction can save state information during the call on processLeft()
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: forUpdate true if this copy is being created to support an update
Parameters: copy true if line numbers are to be copied
Parameters: b true to enable the optimization
Parameters: requireDocumentOrElement true if the argument must be a single element or document node
Parameters: base the static base URI