net.sf.saxon.instruct
public final class ComputedAttribute extends AttributeCreator
Constructor Summary | |
---|---|
ComputedAttribute(Expression attributeName, Expression namespace, NamespaceResolver nsContext, int validationAction, SimpleType schemaType, int annotation, boolean allowNameAsQName)
Construct an Attribute instruction |
Method Summary | |
---|---|
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). |
Expression | copy()
Copy an expression. |
int | evaluateNameCode(XPathContext context)
Determine the name to be used for the attribute, as an integer name code |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int | getCardinality()
Get the static cardinality of this expression |
int | getInstructionNameCode()
Get the name of this instruction |
ItemType | getItemType(TypeHierarchy th)
Get the static type of this expression |
Expression | getNameExpression()
Get the expression used to compute the name of the attribute |
Expression | getNamespaceExpression()
Get the expression used to compute the namespace part of the name of the attribute |
NamespaceResolver | getNamespaceResolver()
Get the namespace resolver used to resolve any prefix in the name of the attribute |
Iterator<Expression> | iterateSubExpressions()
Get the subexpressions of this expression |
void | localTypeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
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(ExpressionVisitor visitor) |
Parameters: attributeName An expression to calculate the attribute name namespace An expression to calculate the attribute namespace nsContext a NamespaceContext object containing the static namespace context of the
stylesheet instruction validationAction e.g. validation=strict, lax, strip, preserve schemaType 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
attribute allowNameAsQName true if the attributeName expression is allowed to evaluate to a value
of type xs:QName (true in XQuery, false in XSLT)
Returns: a set of flags indicating static properties of this expression
Returns: the copy of the original expression
Parameters: context Dynamic evaluation context
Returns: the integer name code for the attribute name
Throws: XPathException
Returns: the static cardinality (exactly one)
Parameters: th the type hierarchy cache
Returns: the static type of the item returned by this expression
Returns: the expression used to compute the name of the attribute
Returns: the expression used to compute the namespace part of the name of the attribute
Returns: the namespace resolver if one has been saved; or null otherwise
Returns: an iterator over the subexpressions
Parameters: offer 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 expression
Throws: XPathException if any error is detected
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found