net.sf.saxon.instruct

Class Copy

public class Copy extends ElementCreator

Handler for xsl:copy elements in stylesheet.
Constructor Summary
Copy(boolean copyNamespaces, boolean inheritNamespaces, SchemaType schemaType, int validation)
Method Summary
voiddisplay(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure.
ItemevaluateItem(XPathContext context)
Evaluate as an expression.
int[]getActiveNamespaces()
Callback to get a list of the intrinsic namespaces that need to be generated for the element.
intgetInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
ItemTypegetItemType(TypeHierarchy th)
Get the item type of the result of this instruction.
intgetNameCode(XPathContext context)
Callback from ElementCreator when constructing an element
protected voidoutputNamespaceNodes(XPathContext context, Receiver receiver)
Callback to output namespace nodes for the new element.
TailCallprocessLeavingTail(XPathContext context)

Constructor Detail

Copy

public Copy(boolean copyNamespaces, boolean inheritNamespaces, SchemaType schemaType, int validation)

Method Detail

display

public void display(int level, NamePool pool, PrintStream out)
Diagnostic print of expression structure. The expression is written to the System.err output stream

Parameters: level indentation level for this expression out

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate as an expression. We rely on the fact that when these instructions are generated by XQuery, there will always be a valueExpression to evaluate the content

getActiveNamespaces

public int[] getActiveNamespaces()
Callback to get a list of the intrinsic namespaces that need to be generated for the element. The result is an array of namespace codes, the codes either occupy the whole array or are terminated by a -1 entry. A result of null is equivalent to a zero-length array.

getInstructionNameCode

public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes

getItemType

public ItemType getItemType(TypeHierarchy th)
Get the item type of the result of this instruction.

Parameters: th

Returns: The context item type.

getNameCode

public int getNameCode(XPathContext context)
Callback from ElementCreator when constructing an element

Parameters: context

Returns: the namecode of the element to be constructed

Throws: XPathException

outputNamespaceNodes

protected void outputNamespaceNodes(XPathContext context, Receiver receiver)
Callback to output namespace nodes for the new element.

Parameters: context The execution context receiver the Receiver where the namespace nodes are to be written

Throws: XPathException

processLeavingTail

public TailCall processLeavingTail(XPathContext context)