Package net.sf.saxon.expr.instruct
Class AttributeCreator
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.instruct.Instruction
net.sf.saxon.expr.instruct.SimpleNodeConstructor
net.sf.saxon.expr.instruct.AttributeCreator
- All Implemented Interfaces:
Serializable
,SourceLocator
,LocationProvider
,SaxonLocator
,TailCallReturner
,ValidatingInstruction
,InstructionInfo
,Locator
- Direct Known Subclasses:
ComputedAttribute
,FixedAttribute
public abstract class AttributeCreator
extends SimpleNodeConstructor
implements ValidatingInstruction
Abstract class for fixed and computed attribute constructor expressions
- See Also:
-
Field Summary
FieldsFields inherited from class net.sf.saxon.expr.instruct.SimpleNodeConstructor
select
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, WATCH_METHOD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the static properties of this expression (other than its type).int
Get the options to be used on the attribute eventReturn the required schema type of the attributeint
Get the validation action requestedfinal void
processValue
(CharSequence value, XPathContext context) Process the value of the node, to create the new node.void
Indicate that the attribute value contains no special characters that might need escapingvoid
setOptions
(int options) Set the options to be used on the attribute eventvoid
Indicate that two attributes with the same name are not acceptable.void
setSchemaType
(SimpleType type) Set the required schema type of the attributevoid
setValidationAction
(int action) Set the validation action requiredprotected void
validateOrphanAttribute
(Orphan orphan, XPathContext context) Validate a newly-constructed parentless attribute using the type and validation attributesMethods inherited from class net.sf.saxon.expr.instruct.SimpleNodeConstructor
checkContent, computeCardinality, createsNewNodes, evaluateItem, evaluateNodeName, getContentExpression, iterate, iterateSubExpressions, localTypeCheck, optimize, processLeavingTail, promoteInst, replaceSubExpression, setSelect, simplify, typeCheck
Methods inherited from class net.sf.saxon.expr.instruct.Instruction
assembleParams, assembleTunnelParams, dynamicError, evaluateAsString, getConstructType, getExpressionName, getImplementationMethod, getInstructionName, getInstructionNameCode, getItemType, getIteratorFromProcessMethod, getSourceLocator, isXSLT, process, promote
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, copy, doPromotion, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, explain, getCardinality, getColumnNumber, getColumnNumber, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, toString, typeError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.xml.transform.SourceLocator
getColumnNumber, getLineNumber, getPublicId, getSystemId
-
Field Details
-
schemaType
SimpleType schemaType
-
-
Constructor Details
-
AttributeCreator
public AttributeCreator()
-
-
Method Details
-
setSchemaType
Set the required schema type of the attribute- Parameters:
type
- the required schema type, if validation against a specific type is required, or null if no validation is required
-
getSchemaType
Return the required schema type of the attribute- Specified by:
getSchemaType
in interfaceValidatingInstruction
- Returns:
- if validation against a schema type was requested, return the schema type (always a simple type). Otherwise, if validation against a specific type was not requested, return null
-
setValidationAction
public void setValidationAction(int action) Set the validation action required- Parameters:
action
- the validation action required, for example strict or lax
-
getValidationAction
public int getValidationAction()Get the validation action requested- Specified by:
getValidationAction
in interfaceValidatingInstruction
- Returns:
- the validation action, for example strict or lax
-
setOptions
public void setOptions(int options) Set the options to be used on the attribute event- Parameters:
options
- Options to be used. The only option currently defined isReceiverOptions.REJECT_DUPLICATES
, which controls whether or not it is an error to create two attributes with the same name for the same element. (This is an error in XQuery but not in XSLT).
-
setRejectDuplicates
public void setRejectDuplicates()Indicate that two attributes with the same name are not acceptable. (This option is set in XQuery, but not in XSLT) -
setNoSpecialChars
public void setNoSpecialChars()Indicate that the attribute value contains no special characters that might need escaping -
getOptions
public int getOptions()Get the options to be used on the attribute event- Returns:
- the option flags to be used
-
computeSpecialProperties
public int computeSpecialProperties()Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.- Overrides:
computeSpecialProperties
in classSimpleNodeConstructor
- Returns:
- a set of flags indicating static properties of this expression
-
processValue
Process the value of the node, to create the new node.- Specified by:
processValue
in classSimpleNodeConstructor
- Parameters:
value
- the string value of the new nodecontext
- the dynamic evaluation context- Throws:
XPathException
-
validateOrphanAttribute
Validate a newly-constructed parentless attribute using the type and validation attributes- Parameters:
orphan
- the new attribute nodecontext
- the dynamic evaluation context- Throws:
XPathException
- if validation fails
-