public final class Attribute extends SimpleNodeConstructor
selectlocationId, staticPropertiesEVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD| Constructor and Description |
|---|
Attribute(Expression attributeName,
Expression namespace,
NamespaceResolver nsContext,
int validationAction,
SimpleType schemaType,
int annotation,
boolean allowNameAsQName)
Construct an Attribute instruction
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkPermittedContents(SchemaType parentType,
StaticContext env,
boolean whole)
Check that any elements and attributes constructed or returned by this expression are acceptable
in the content model of a given complex type.
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
void |
display(int level,
java.io.PrintStream out,
Configuration config)
Display this instruction as an expression, for diagnostics
|
int |
evaluateNameCode(XPathContext context) |
int |
getCardinality()
Determine the static cardinality of the expression.
|
int |
getInstructionNameCode()
Get the name of this instruction
|
ItemType |
getItemType(TypeHierarchy th)
Get the item type of the items returned by evaluating this instruction
|
java.util.Iterator |
iterateSubExpressions()
Get the subexpressions of this expression
|
void |
localTypeCheck(StaticContext env,
ItemType contextItemType) |
TailCall |
processLeavingTail(XPathContext context)
Process this instruction
|
protected void |
promoteInst(PromotionOffer offer)
Offer promotion for subexpressions.
|
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression
|
void |
setRejectDuplicates()
Indicate that two attributes with the same name are not acceptable.
|
Expression |
simplify(StaticContext env)
Simplify an expression.
|
checkContent, createsNewNodes, evaluateItem, expandChildren, getSelect, iterate, optimize, setSelect, typeCheckappendItem, assembleParams, assembleTunnelParams, computeCardinality, dynamicError, evaluateAsString, getImplementationMethod, getInstructionInfo, getSourceLocator, isXSLT, process, promoteadoptChildExpression, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeErrorpublic Attribute(Expression attributeName, Expression namespace, NamespaceResolver nsContext, int validationAction, SimpleType schemaType, int annotation, boolean allowNameAsQName)
attributeName - An expression to calculate the attribute namenamespace - An expression to calculate the attribute namespacensContext - a NamespaceContext object containing the static namespace context of the
stylesheet instructionvalidationAction - e.g. validation=strict, lax, strip, preserveschemaType - Type against which the attribute must be validated. This must not be a namespace-sensitive
type; it is the caller's responsibility to check this.annotation - Integer code identifying the type named in the type attributeallowNameAsQName - public void setRejectDuplicates()
public int getInstructionNameCode()
getInstructionNameCode in class Instructionpublic ItemType getItemType(TypeHierarchy th)
InstructiongetItemType in interface ExpressiongetItemType in class Instructionpublic int getCardinality()
ComputedExpressiongetCardinality in interface ExpressiongetCardinality in class ComputedExpressionpublic int computeSpecialProperties()
computeSpecialProperties in class SimpleNodeConstructorpublic Expression simplify(StaticContext env) throws XPathException
Instructionsimplify in interface Expressionsimplify in class SimpleNodeConstructorenv - the static contextXPathException - if an error is discovered during expression
rewritingpublic void localTypeCheck(StaticContext env, ItemType contextItemType) throws XPathException
localTypeCheck in class SimpleNodeConstructorXPathExceptionpublic java.util.Iterator iterateSubExpressions()
iterateSubExpressions in interface ExpressioniterateSubExpressions in class SimpleNodeConstructorpublic boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression in interface ContainerreplaceSubExpression in class SimpleNodeConstructororiginal - the original subexpressionreplacement - the replacement subexpressionprotected void promoteInst(PromotionOffer offer) throws XPathException
promoteInst in class SimpleNodeConstructoroffer - details of the offer, for example the offer to move
expressions that don't depend on the context to an outer level in
the containing expressionXPathException - if any error is detectedpublic void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException
checkPermittedContents in interface ExpressioncheckPermittedContents in class ComputedExpressionparentType - The schema typeenv - the static contextwhole - true if this expression is expected to make the whole content of the type, false
if it is expected to make up only a partXPathException - if the expression doesn't match the required content typepublic TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail in interface TailCallReturnerprocessLeavingTail in class Instructioncontext - the dynamic context of the transformationXPathExceptionpublic int evaluateNameCode(XPathContext context) throws XPathException, XPathException
evaluateNameCode in class SimpleNodeConstructorXPathExceptionpublic void display(int level,
java.io.PrintStream out,
Configuration config)
display in interface Expressiondisplay in class SimpleNodeConstructorlevel - indentation level for this expressionout - Output destination