net.sf.saxon.instruct
Class SimpleNodeConstructor
java.lang.Object
|
+--net.sf.saxon.instruct.Instruction
|
+--net.sf.saxon.instruct.ExprInstruction
|
+--net.sf.saxon.instruct.SimpleNodeConstructor
- All Implemented Interfaces:
- Expression, java.io.Serializable
- Direct Known Subclasses:
- Attribute, Comment, FixedAttribute, Namespace, ProcessingInstruction, Text
- public abstract class SimpleNodeConstructor
- extends ExprInstruction
Common superclass for XSLT instructions whose content template produces a text
value: xsl:attribute, xsl:comment, xsl:processing-instruction, xsl:namespace,
and xsl:text
- See Also:
- Serialized Form
Methods inherited from class net.sf.saxon.instruct.ExprInstruction |
effectiveBooleanValue, evaluateAsString, getCardinality, getDependencies, getItemType, getSpecialProperties, getSubExpressions, iterate, promote, promoteInst, simplify |
Methods inherited from class net.sf.saxon.instruct.Instruction |
assembleParams, assembleTunnelParams, getChildren, getInstructionDetails, getInstructionName, getLineNumber, getResultType, getSystemId, process, processChildren, processChildrenLeavingTail, processLeavingTail, recoverableError, setChildren, setInstructionDetails, setSourceLocation, styleError, styleError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
select
protected Expression select
SimpleNodeConstructor
public SimpleNodeConstructor()
setSelect
public final void setSelect(Expression select)
typeCheck
public abstract void typeCheck(StaticContext env)
throws XPathException
XPathException
analyze
public Expression analyze(StaticContext env)
throws XPathException
- The analyze() method is called in XQuery, where node constructors
are implemented as Expressions. In this case the required type for the
select expression is a single string.
- Parameters:
env
- The static context for the query
- Returns:
- the rewritten expression
- Throws:
XPathException
- if any static errors are found in this expression
or any of its children
getXPathExpressions
public void getXPathExpressions(java.util.List list)
- Specified by:
getXPathExpressions
in class ExprInstruction
expandChildren
public java.lang.CharSequence expandChildren(XPathContext context)
throws javax.xml.transform.TransformerException
- Expand the stylesheet elements subordinate to this one, returning the result
as a string. The expansion must not generate any element or attribute nodes.
- Parameters:
context
- The dynamic context for the transformation
javax.xml.transform.TransformerException
evaluateItem
public Item evaluateItem(XPathContext context)
throws XPathException
- 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
- Specified by:
evaluateItem
in interface Expression
- Overrides:
evaluateItem
in class ExprInstruction
- Parameters:
context
- The context in which the expression is to be evaluated
- Returns:
- the node or atomic value that results from evaluating the
expression; or null to indicate that the result is an empty
sequence
- Throws:
XPathException
- if any dynamic error occurs evaluating the
expression
evaluateNameCode
protected int evaluateNameCode(XPathContext context)
throws XPathException,
javax.xml.transform.TransformerException
XPathException
javax.xml.transform.TransformerException
display
public void display(int level,
NamePool pool)
- Display this instruction as an expression, for diagnostics
- Parameters:
level
- indentation level for this expression