|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression net.sf.saxon.instruct.Instruction net.sf.saxon.instruct.SimpleNodeConstructor net.sf.saxon.instruct.FixedAttribute
public final class FixedAttribute
An instruction derived from an xsl:attribute element in stylesheet, or from an attribute constructor in XQuery. This version deals only with attributes whose name is known at compile time. It is also used for attributes of literal result elements. The value of the attribute is in general computed at run-time.
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
---|---|
FixedAttribute(int nameCode,
int validationAction,
SimpleType schemaType,
int annotation)
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. |
Expression |
copy()
Copy an expression. |
Item |
evaluateItem(XPathContext context)
Evaluate as an expression. |
int |
evaluateNameCode(XPathContext context)
Run-time method to compute the name of the node being constructed. |
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int |
getAttributeNameCode()
Get the name pool name code of the attribute to be constructed |
int |
getCardinality()
Determine the static cardinality of the expression. |
InstructionInfo |
getInstructionInfo()
Get InstructionInfo for this expression |
int |
getInstructionNameCode()
Get the name of this instruction (return 'xsl:attribute') |
ItemType |
getItemType(TypeHierarchy th)
Get the item type of the items returned by evaluating this instruction |
int |
getValidationAction()
Get the validation action requested |
void |
localTypeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
Method to perform type-checking specific to the kind of instruction |
TailCall |
processLeavingTail(XPathContext context)
Process this instruction |
void |
setNoSpecialChars()
Indicate that the attribute value contains no special characters that might need escaping |
void |
setRejectDuplicates()
Indicate that two attributes with the same name are not acceptable. |
void |
setSelect(Expression select,
Configuration config)
Set the expression defining the value of the attribute. |
Methods inherited from class net.sf.saxon.instruct.SimpleNodeConstructor |
---|
computeCardinality, computeSpecialProperties, createsNewNodes, expandChildren, getSelect, iterate, iterateSubExpressions, optimize, replaceSubExpression, simplify, typeCheck |
Methods inherited from class net.sf.saxon.instruct.Instruction |
---|
evaluateAsString, getImplementationMethod, getSourceLocator, isXSLT, process, promote |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
Constructor Detail |
---|
public FixedAttribute(int nameCode, int validationAction, SimpleType schemaType, int annotation)
nameCode
- Represents the attribute namevalidationAction
- the validation required, for example strict or laxschemaType
- the schema type against which validation is required, null if not applicableannotation
- Integer code identifying the type named in the type
attribute
of the instruction - zero if the attribute was not presentMethod Detail |
---|
public int getInstructionNameCode()
getInstructionNameCode
in class Instruction
public void setRejectDuplicates()
public void setNoSpecialChars()
public void setSelect(Expression select, Configuration config) throws XPathException
setSelect
in class SimpleNodeConstructor
select
- The expression defining the content of the attributeconfig
- The Saxon configuration
XPathException
- if the expression is a constant, and validation is requested, and
the constant doesn't match the required type.public InstructionInfo getInstructionInfo()
Expression
getInstructionInfo
in interface InstructionInfoProvider
getInstructionInfo
in class Instruction
public int getAttributeNameCode()
public ItemType getItemType(TypeHierarchy th)
Instruction
getItemType
in class Instruction
th
- the type hierarchy cache
public int getCardinality()
Expression
getCardinality
in class Expression
public int getValidationAction()
public Expression copy()
copy
in class Expression
public void localTypeCheck(ExpressionVisitor visitor, ItemType contextItemType)
SimpleNodeConstructor
localTypeCheck
in class SimpleNodeConstructor
visitor
- an expression visitorcontextItemType
- the static type of the context itempublic int evaluateNameCode(XPathContext context)
SimpleNodeConstructor
evaluateNameCode
in class SimpleNodeConstructor
context
- the XPath dynamic evaluation context
public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException
checkPermittedContents
in class Expression
parentType
- the "given complex type": the method is checking that the nodes returned by this
expression are acceptable members of the content model of this typeenv
- the static contextwhole
- if true, we want to check that the value of this expression satisfies the content model
as a whole; if false we want to check that the value of the expression is acceptable as one part
of the content
XPathException
- if the value delivered by this expression cannot be part of the content model
of the given typepublic TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
context
- the dynamic context of the transformation
XPathException
public Item evaluateItem(XPathContext context) throws XPathException
SimpleNodeConstructor
evaluateItem
in interface EvaluableItem
evaluateItem
in class SimpleNodeConstructor
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic void explain(ExpressionPresenter out)
explain
in class Expression
out
- the expression presenter used to display the structure
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |