|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--net.sf.saxon.instruct.Instruction
|
+--net.sf.saxon.instruct.ExprInstruction
|
+--net.sf.saxon.instruct.CopyOf
An xsl:copy-of element in the stylesheet.
| Field Summary |
| Fields inherited from class net.sf.saxon.instruct.Instruction |
children |
| Constructor Summary | |
CopyOf(Expression select,
boolean copyNamespaces,
int validation,
SchemaType schemaType)
|
|
| Method Summary | |
Expression |
analyze(StaticContext env)
Perform static analysis of an expression and its subexpressions. |
protected static void |
copyAttribute(NodeInfo source,
SchemaType schemaType,
int validation,
Controller controller)
|
void |
display(int level,
NamePool pool)
Diagnostic print of expression structure. |
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression. |
Item |
evaluateItem(XPathContext context)
Return the first item if there is one, or null if not |
int |
getCardinality()
Determine the static cardinality of the expression. |
int |
getDependencies()
Determine which aspects of the context the expression depends on. |
java.lang.String |
getInstructionName()
Get the name of this instruction, for diagnostics and tracing |
ItemType |
getItemType()
Determine the data type of the expression, if possible. |
int |
getSpecialProperties()
Get the static properties of this expression (other than its type). |
Expression[] |
getSubExpressions()
Get the immediate sub-expressions of this expression. |
protected void |
getXPathExpressions(java.util.List list)
Get all the XPath expressions associated with this instruction (in XSLT terms, the expression present on attributes of the instruction, as distinct from the child instructions in a sequence construction) |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
TailCall |
processLeavingTail(XPathContext context)
Process this xsl:copy-of instruction |
protected void |
promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites. |
void |
setRequireDocumentOrElement(boolean requireDocumentOrElement)
For XQuery, the operand (select) must be a single element or document node. |
void |
setValidationContext(ValidationContext validationContext)
Set the validation context |
Expression |
simplify()
Simplify an expression. |
| Methods inherited from class net.sf.saxon.instruct.ExprInstruction |
evaluateAsString, promote |
| Methods inherited from class net.sf.saxon.instruct.Instruction |
assembleParams, assembleTunnelParams, displayChildren, dynamicError, dynamicError, getChildren, getColumnNumber, getExecutable, getInstructionNamespace, getLineNumber, getPublicId, getSourceLocator, getSystemId, process, processChildren, processChildrenLeavingTail, recoverableError, setChildren, setExecutable, setSourceLocation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CopyOf(Expression select,
boolean copyNamespaces,
int validation,
SchemaType schemaType)
| Method Detail |
public java.lang.String getInstructionName()
getInstructionName in class Instructionpublic void setRequireDocumentOrElement(boolean requireDocumentOrElement)
requireDocumentOrElement - public void setValidationContext(ValidationContext validationContext)
validationContext -
public TailCall processLeavingTail(XPathContext context)
throws javax.xml.transform.TransformerException
processLeavingTail in interface InstrprocessLeavingTail in class Instructioncontext - the dynamic context for the transformation
javax.xml.transform.TransformerException
protected static void copyAttribute(NodeInfo source,
SchemaType schemaType,
int validation,
Controller controller)
throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public Expression simplify()
throws XPathException
ExprInstruction
simplify in interface Expressionsimplify in class ExprInstructionXPathException - if an error is discovered during expression
rewritingpublic ItemType getItemType()
ExpressionThis method should always return a result, though it may be the best approximation that is available at the time.
getItemType in interface ExpressiongetItemType in class Instructionpublic int getCardinality()
ExpressionDetermine the static cardinality of the expression. This establishes how many items there will be in the result of the expression, at compile time (i.e., without actually evaluating the result.
This method should always return a result, though it may be the best approximation that is available at the time.
getCardinality in interface ExpressiongetCardinality in class Instructionpublic int getDependencies()
ExprInstructionStaticProperty.DEPENDS_ON_CONTEXT_ITEM and
StaticProperty.DEPENDS_ON_CURRENT_ITEM. The default implementation combines the intrinsic
dependencies of this expression with the dependencies of the subexpressions,
computed recursively. This is overridden for expressions such as FilterExpression
where a subexpression's dependencies are not necessarily inherited by the parent
expression.
getDependencies in interface ExpressiongetDependencies in class ExprInstructionpublic int getSpecialProperties()
ExprInstruction
getSpecialProperties in interface ExpressiongetSpecialProperties in class ExprInstruction
protected void promoteInst(PromotionOffer offer)
throws XPathException
ExprInstruction
promoteInst in class ExprInstructionoffer - The type of rewrite being offered
XPathExceptionprotected void getXPathExpressions(java.util.List list)
ExprInstruction
getXPathExpressions in class ExprInstructionlist - A list to be populated with the list of XPath expressions
public Expression analyze(StaticContext env)
throws XPathException
This checks statically that the operands of the expression have the correct type; if necessary it generates code to do run-time type checking or type conversion. A static type error is reported only if execution cannot possibly succeed, that is, if a run-time type error is inevitable. The call may return a modified form of the expression.
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable. However, the types of such functions and variables will only be accurately known if they have been explicitly declared.
analyze in interface Expressionanalyze in class ExprInstructionenv - the static context of the expression
XPathException - if an error is discovered during this phase
(typically a type error)
public void display(int level,
NamePool pool)
level - indentation level for this expressionpublic Expression[] getSubExpressions()
ExprInstruction
getSubExpressions in interface ExpressiongetSubExpressions in class ExprInstruction
public Item evaluateItem(XPathContext context)
throws XPathException
evaluateItem in interface ExpressionevaluateItem in class ExprInstructioncontext -
XPathException
public boolean effectiveBooleanValue(XPathContext context)
throws XPathException
ExprInstruction
effectiveBooleanValue in interface ExpressioneffectiveBooleanValue in class ExprInstructioncontext - The context in which the expression is to be evaluated
XPathException - if any dynamic error occurs evaluating the
expression
public SequenceIterator iterate(XPathContext context)
throws XPathException
ExprInstruction
iterate in interface Expressioniterate in class ExprInstructioncontext - supplies the context for evaluation
XPathException - if any dynamic error occurs evaluating the
expression
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||