net.sf.saxon.instruct
Class FixedElement

java.lang.Object
  extended by net.sf.saxon.instruct.Instruction
      extended by net.sf.saxon.instruct.ExprInstruction
          extended by net.sf.saxon.instruct.ElementCreator
              extended by net.sf.saxon.instruct.FixedElement
All Implemented Interfaces:
Serializable, SourceLocator, Expression

public class FixedElement
extends ElementCreator

An instruction that creates an element node whose name is known statically. Used for literal results elements in XSLT, for direct element constructors in XQuery, and for xsl:element in cases where the name and namespace are known statically.

See Also:
Serialized Form

Field Summary
protected  int[] namespaceCodes
           
 
Fields inherited from class net.sf.saxon.instruct.ElementCreator
schemaType, useAttributeSets, validation, validationContext
 
Fields inherited from class net.sf.saxon.instruct.Instruction
children
 
Constructor Summary
FixedElement(int nameCode, int[] namespaceCodes, AttributeSet[] useAttributeSets, SchemaType schemaType, int validation)
          Create an instruction that creates a new element node
 
Method Summary
 void display(int level, NamePool pool)
          Display this instruction as an expression, for diagnostics
protected  int getNameCode(XPathContext context)
          Callback from the superclass ElementCreator to get the nameCode for the element name
 void getXPathExpressions(List list)
           
protected  void outputNamespaceNodes(XPathContext context, Receiver out)
          Callback to output namespace nodes for the new element.
 void setInstructionDetails(Controller controller, NamePool namePool, InstructionDetails details)
          Get the name of this instruction for diagnostic and tracing purposes
 
Methods inherited from class net.sf.saxon.instruct.ElementCreator
analyze, evaluateItem, getResultType, getValidationContext, getValidationMode, processLeavingTail, promoteInst, setValidationContext, setValidationMode
 
Methods inherited from class net.sf.saxon.instruct.ExprInstruction
effectiveBooleanValue, evaluateAsString, getCardinality, getDependencies, getItemType, getSpecialProperties, getSubExpressions, iterate, promote, simplify
 
Methods inherited from class net.sf.saxon.instruct.Instruction
assembleParams, assembleTunnelParams, getChildren, getColumnNumber, getInstructionDetails, getInstructionName, getLineNumber, getPublicId, getSystemId, getSystemId, process, processChildren, processChildrenLeavingTail, recoverableError, setChildren, setSourceLocation, styleError, styleError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceCodes

protected int[] namespaceCodes
Constructor Detail

FixedElement

public FixedElement(int nameCode,
                    int[] namespaceCodes,
                    AttributeSet[] useAttributeSets,
                    SchemaType schemaType,
                    int validation)
Create an instruction that creates a new element node

Parameters:
nameCode - Represents the name of the element node
namespaceCodes - List of namespaces to be added to the element node. May be null if none are required.
useAttributeSets - Array of attribute sets to be expanded. May be null if none are required.
schemaType - Type annotation for the new element node
Method Detail

getXPathExpressions

public void getXPathExpressions(List list)
Specified by:
getXPathExpressions in class ExprInstruction

setInstructionDetails

public void setInstructionDetails(Controller controller,
                                  NamePool namePool,
                                  InstructionDetails details)
Get the name of this instruction for diagnostic and tracing purposes

Specified by:
setInstructionDetails in class Instruction

getNameCode

protected int getNameCode(XPathContext context)
Callback from the superclass ElementCreator to get the nameCode for the element name

Specified by:
getNameCode in class ElementCreator
Parameters:
context - The evaluation context (not used)
Returns:
the name code for the element name

outputNamespaceNodes

protected void outputNamespaceNodes(XPathContext context,
                                    Receiver out)
                             throws TransformerException
Description copied from class: ElementCreator
Callback to output namespace nodes for the new element.

Specified by:
outputNamespaceNodes in class ElementCreator
Parameters:
context - The execution context
out - the Receiver where the namespace nodes are to be written
Throws:
TransformerException

display

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

Parameters:
level - indentation level for this expression