## net.sf.saxon.instruct
Class FixedElement

    java.lang.Object
      |
      +--net.sf.saxon.expr.ComputedExpression
            |
            +--net.sf.saxon.instruct.Instruction
                  |
                  +--net.sf.saxon.instruct.InstructionWithChildren
                        |
                        +--net.sf.saxon.instruct.ElementCreator
                              |
                              +--net.sf.saxon.instruct.FixedElement

All Implemented Interfaces:
  Container, Expression, InstructionInfoProvider, java.io.Serializable, javax.xml.transform.SourceLocator

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
`inheritNamespaces, schemaType, useAttributeSets, validation`

Fields inherited from class net.sf.saxon.instruct.InstructionWithChildren
`children`

Fields inherited from class net.sf.saxon.expr.ComputedExpression
`locationId, staticProperties`

Fields inherited from interface net.sf.saxon.expr.Expression
`EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD`

Constructor Summary
`FixedElement(int nameCode, int[] namespaceCodes, AttributeSet[] useAttributeSets, boolean inheritNamespaces, SchemaType schemaType, int validation)` Create an instruction that creates a new element node

Method Summary
`void` `display(int level, NamePool pool, java.io.PrintStream out)` Display this instruction as an expression, for diagnostics
`InstructionInfo` `getInstructionInfo()` Get InstructionInfo for this expression
`protected int` `getNameCode(XPathContext context)` Callback from the superclass ElementCreator to get the nameCode for the element name
`protected void` `outputNamespaceNodes(XPathContext context, Receiver out)` Callback to output namespace nodes for the new element.

Methods inherited from class net.sf.saxon.instruct.ElementCreator
`evaluateItem, getCardinality, getItemType, getValidationMode, processLeavingTail, setValidationMode`

Methods inherited from class net.sf.saxon.instruct.InstructionWithChildren
`analyze, displayChildren, getChildren, iterateSubExpressions, processChildren, processChildrenLeavingTail, promoteInst, setChildren, simplify`

Methods inherited from class net.sf.saxon.instruct.Instruction
`appendItem, assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, dynamicError, dynamicError, effectiveBooleanValue, evaluateAsString, getImplementationMethod, getInstructionNameCode, getSourceLocator, iterate, process, promote`

Methods inherited from class net.sf.saxon.expr.ComputedExpression
`adoptChildExpression, computeDependencies, computeStaticProperties, dynamicError, dynamicError, getColumnNumber, getConstructType, getDependencies, getExecutable, getIntrinsicDependencies, getLineNumber, getLocationId, getParentExpression, getPublicId, getSpecialProperties, getSystemId, markTailFunctionCalls, resetStaticProperties, setLocationId, setParentExpression, typeError`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface javax.xml.transform.SourceLocator
`getColumnNumber, getLineNumber, getPublicId, getSystemId`

Field Detail

### namespaceCodes

    protected int[] namespaceCodes

Constructor Detail

### FixedElement

    public FixedElement(int nameCode,
                        int[] namespaceCodes,
                        AttributeSet[] useAttributeSets,
                        boolean inheritNamespaces,
                        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

### getInstructionInfo

    public InstructionInfo getInstructionInfo()

  Description copied from class: `ComputedExpression`
  Get InstructionInfo for this expression

  Specified by:
    `getInstructionInfo` in interface `InstructionInfoProvider`
  Overrides:
    `getInstructionInfo` 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 XPathException

  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:
    `XPathException`

### display

    public void display(int level,
                        NamePool pool,
                        java.io.PrintStream out)

  Display this instruction as an expression, for diagnostics

  Parameters:
    `level` - indentation level for this expression
    `pool` - NamePool used to expand any names appearing in the expression
    `out` - Output destination