net.sf.saxon.instruct
Class FixedElement
- SourceLocator, EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator, TailCallReturner
public class FixedElement
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.
FixedElement(int nameCode, int[] namespaceCodes, boolean inheritNamespaces, SchemaType schemaType, int validation) - Create an instruction that creates a new element node
|
checkContentSequence , computeSpecialProperties , evaluateItem , getActiveNamespaces , getImplementationMethod , getItemType , getNameCode , getNewBaseURI , isInheritNamespaces , isPreservingTypes , iterateEvents , outputNamespaceNodes , processLeavingTail , setValidationMode , suppressValidation |
addToPathMap , checkContentSequence , computeCardinality , createsNewNodes , getBaseURI , getCardinality , getContentExpression , getSchemaType , getValidationMode , isLazyConstruction , isNamespaceSensitive , iterateSubExpressions , optimize , promoteInst , replaceSubExpression , setBaseURI , setContentExpression , setLazyConstruction , setSchemaType , setValidationMode , simplify , typeCheck |
assembleParams , assembleTunnelParams , computeCardinality , computeSpecialProperties , createsNewNodes , dynamicError , evaluateAsString , evaluateItem , getImplementationMethod , getInstructionInfo , getInstructionNameCode , getItemType , getSourceLocator , isXSLT , iterate , process , processLeavingTail , promote , promoteInst , simplify |
addToPathMap , adoptChildExpression , checkPermittedContents , computeCardinality , computeDependencies , computeSpecialProperties , computeStaticProperties , copy , display , doPromotion , dynamicError , effectiveBooleanValue , evaluateAsString , evaluateItem , explain , explain , findParentOf , getCardinality , getColumnNumber , getConstructType , getContainer , getDependencies , getExecutable , getHostLanguage , getImplementationMethod , getInstructionInfo , getIntrinsicDependencies , getItemType , getLineNumber , getLocationId , getLocationProvider , getPublicId , getSlotsUsed , getSpecialProperties , getSystemId , hasLoopingSubexpression , implementsStaticTypeCheck , iterate , iterateEvents , iterateSubExpressions , markTailFunctionCalls , optimize , process , promote , replaceSubExpression , resetLocalStaticProperties , setContainer , setFiltered , setFlattened , setLocationId , simplify , staticTypeCheck , suppressValidation , toString , typeCheck , typeError |
namespaceCodes
protected int[] namespaceCodes
FixedElement
public FixedElement(int nameCode,
int[] namespaceCodes,
boolean inheritNamespaces,
SchemaType schemaType,
int validation)
Create an instruction that creates a new element node
nameCode
- Represents the name of the element nodenamespaceCodes
- List of namespaces to be added to the element node.
May be null if none are required.inheritNamespaces
- true if the children of this element are to inherit its namespacesschemaType
- Type annotation for the new element nodevalidation
- Validation mode to be applied, for example STRICT, LAX, SKIP
checkPermittedContents
public void checkPermittedContents(SchemaType parentType,
StaticContext env,
boolean whole)
throws XPathException
Check that any elements and attributes constructed or returned by this expression are acceptable
in the content model of a given complex type. It's always OK to say yes, since the check will be
repeated at run-time. The process of checking element and attribute constructors against the content
model of a complex type also registers the type of content expected of those constructors, so the
static validation can continue recursively.
- checkPermittedContents in interface Expression
copy
public Expression copy()
Copy an expression. This makes a deep copy.
- copy in interface Expression
- the copy of the original expression
explain
public void explain(ExpressionPresenter out)
Diagnostic print of expression structure. The abstract expression tree
is written to the supplied output destination.
- explain in interface Expression
getActiveNamespaces
public int[] getActiveNamespaces()
Callback to get a list of the intrinsic namespaces that need to be generated for the element.
The result is an array of namespace codes, the codes either occupy the whole array or are
terminated by a -1 entry. A result of null is equivalent to a zero-length array.
- getActiveNamespaces in interface ElementCreator
getNameCode
public int getNameCode(XPathContext context)
Callback from the superclass ElementCreator to get the nameCode
for the element name
- getNameCode in interface ElementCreator
context
- The evaluation context (not used)
- the name code for the element name
getNewBaseURI
public String getNewBaseURI(XPathContext context)
Get the base URI for the element being constructed
- getNewBaseURI in interface ElementCreator
context
- the XPath dynamic evaluation context
- the base URI of the constructed element
getURICode
public short getURICode(NamePool pool)
Get the URI code representing the namespace URI of the element being constructed
optimize
public Expression optimize(ExpressionVisitor visitor,
ItemType contextItemType)
throws XPathException
Perform optimisation of an expression and its subexpressions. This is the third and final
phase of static optimization.
This method is called after all references to functions and variables have been resolved
to the declaration of the function or variable, and after all type checking has been done.
- optimize in interface ParentNodeConstructor
visitor
- an expression visitorcontextItemType
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
- the original expression, rewritten if appropriate to optimize execution
XPathException
- if an error is discovered during this phase
(typically a type error)