net.sf.saxon.instruct
Class SimpleNodeConstructor

java.lang.Object
  extended bynet.sf.saxon.instruct.Instruction
      extended bynet.sf.saxon.instruct.ExprInstruction
          extended bynet.sf.saxon.instruct.SimpleNodeConstructor
All Implemented Interfaces:
Expression, Serializable, SourceLocator
Direct Known Subclasses:
Attribute, Comment, FixedAttribute, Namespace, ProcessingInstruction, Text, ValueOf

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

Field Summary
protected  Expression select
           
protected  Expression separator
           
 
Fields inherited from class net.sf.saxon.instruct.Instruction
children
 
Constructor Summary
SimpleNodeConstructor()
           
 
Method Summary
 Expression analyze(StaticContext env)
          The analyze() method is called in XQuery, where node constructors are implemented as Expressions.
 void display(int level, NamePool pool)
          Display this instruction as an expression, for diagnostics
 Item evaluateItem(XPathContext context)
          Evaluate as an expression.
protected  int evaluateNameCode(XPathContext context)
           
 CharSequence expandChildren(XPathContext context)
          Expand the stylesheet elements subordinate to this one, returning the result as a string.
 void getXPathExpressions(List list)
           
 void setSelect(Expression select)
           
 void setSeparator(Expression separator)
           
abstract  void typeCheck(StaticContext env)
           
 
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, getColumnNumber, getInstructionDetails, getInstructionName, getLineNumber, getPublicId, getResultType, getSystemId, 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
 

Field Detail

select

protected Expression select

separator

protected Expression separator
Constructor Detail

SimpleNodeConstructor

public SimpleNodeConstructor()
Method Detail

setSelect

public final void setSelect(Expression select)

setSeparator

public final void setSeparator(Expression separator)

typeCheck

public abstract void typeCheck(StaticContext env)
                        throws XPathException
Throws:
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(List list)
Specified by:
getXPathExpressions in class ExprInstruction

expandChildren

public CharSequence expandChildren(XPathContext context)
                            throws 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
Throws:
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
Throws:
XPathException

evaluateNameCode

protected int evaluateNameCode(XPathContext context)
                        throws XPathException,
                               TransformerException
Throws:
XPathException
TransformerException

display

public void display(int level,
                    NamePool pool)
Display this instruction as an expression, for diagnostics

Parameters:
level - indentation level for this expression