Interface XDynamicContext
-
public interface XDynamicContextUse the
XDynamicContextto override execution-time settings. These are settings used when executing a prepared expression, query or stylesheet. See theXPathExecutable,XQueryExecutable, andXSLTExecutableexecutemethods that take anXDynamicContextas an argument. TheXFactoryclass has the methodnewDynamicContextfor creating new instances.Execution time settings such as the values of external variables and resolvers for source, collections and results may be different for each call to the
executemethods on anExecutable.Examples of execution-time settings:
- Bind values to external variables (XPath and XQuery) or parameters (XSLT).
- Bind an external function implementation.
- Set source, collection and result resolvers.
- Bind a
Collatoror aLocaleto a collation URI.
-
-
Method Summary
Methods
Modifier and Type
Method and Description
void
bind(javax.xml.namespace.QName name,
java.math.BigDecimal value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
java.math.BigInteger value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
boolean value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
byte value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
byte[] value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
double value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
javax.xml.datatype.Duration value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
float value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
int value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
long value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
org.w3c.dom.Node value)
Bind a value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
java.lang.Object value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
javax.xml.namespace.QName value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
short value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
javax.xml.transform.Source source)
Bind a Source object as a value for a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
java.lang.String value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
XItemView item)
Bind a single item value to a variable (XPath, XQuery) or a param (XSLT).
void
bind(javax.xml.namespace.QName name,
javax.xml.datatype.XMLGregorianCalendar value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
void
bindCollation(java.lang.String uri,
java.text.Collator collator)
Associates the specified collation URI with the specified
java.text.Collator.
void
bindCollation(java.lang.String uri,
java.util.Locale locale)
Associates the specified collation URI with the
java.text.Collator for the specified
java.util.Locale.
void
bindFunction(javax.xml.namespace.QName qname,
java.lang.reflect.Method method)
Bind a function to a name.
void
bindFunction(javax.xml.namespace.QName qname,
java.lang.reflect.Method method,
java.lang.Object instanceObject)
Bind a function to a name.
void
bindSequence(javax.xml.namespace.QName name,
java.math.BigDecimal[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
java.math.BigInteger[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
boolean[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
byte[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT)
depending on the type.
void
bindSequence(javax.xml.namespace.QName name,
byte[][] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
double[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
javax.xml.datatype.Duration[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
float[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
int[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
long[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
javax.xml.namespace.QName[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
short[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
java.lang.String[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
javax.xml.datatype.XMLGregorianCalendar[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
void
bindSequence(javax.xml.namespace.QName name,
XSequenceCursor sequence)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
java.lang.String
getBaseOutputURI()
Get the base output URI.
java.text.Collator
getCollation(java.lang.String uri)
Get the Collator associated with the given
collation URI.
XCollectionResolver
getCollectionResolver()
Get the registered resolver for collections.
boolean
getFeature(java.lang.String name)
Get the state of the named feature.
javax.xml.datatype.Duration
getImplicitTimeZone()
Get the implicit time zone as a Duration object.
XMessageHandler
getMessageHandler()
Get the dynamic message handler.
XResultResolver
getResultResolver()
Get the registered resolver for result documents.
XSourceResolver
getSourceResolver()
Get the registered resolver for source documents.
XUnparsedTextResolver
getUnparsedTextResolver()
Get the registered resolver for unparsed text resources.
javax.xml.namespace.QName
getXSLTInitialMode()
Get the name of the initial mode
javax.xml.namespace.QName
getXSLTInitialTemplate()
Get the name of the initial template.
void
removeBinding(javax.xml.namespace.QName qname)
Remove the binding for the specified variable.
void
removeCollationBinding(java.lang.String uri)
Remove the Collator associated with the given
collation URI.
void
removeFunctionBinding(javax.xml.namespace.QName qname,
int arity)
Remove the binding for the specified function.
void
setBaseOutputURI(java.lang.String uri)
Sets the base URI to use when resolving result documents.
void
setCollectionResolver(XCollectionResolver collectionResolver)
Registers a URI resolver for collections.
void
setFeature(java.lang.String name,
boolean value)
Set a feature for this dynamic context.
void
setImplicitTimeZone(javax.xml.datatype.Duration implicitTimeZone)
Sets the implicit time zone.
void
setMessageHandler(XMessageHandler handler)
Set a message handler to process dynamic errors and messages.
void
setResultResolver(XResultResolver resultResolver)
Register a resolver for result documents.
void
setSourceResolver(XSourceResolver sourceResolver)
Register a resolver for dynamically resolved source documents
such as for the fn:doc function and the XSLT
document function.
void
setUnparsedTextResolver(XUnparsedTextResolver unparsedTextResolver)
Register a resolver for external resources loaded through the
XSLT unparsed-text function.
void
setXSLTInitialMode(javax.xml.namespace.QName initialMode)
Specify a mode to use as the initial mode in an XSLT
transformation.
void
setXSLTInitialTemplate(javax.xml.namespace.QName initialTemplate)
Specify a named template to use as the initial template
in an XSLT transformation.
-
-
Method Detail
-
bind
void bind(javax.xml.namespace.QName name,
java.lang.Object value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
java.lang.String value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
java.lang.String[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
boolean value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
boolean[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
byte value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
byte[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT)
depending on the type.
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
Use this method for hexBinary or base64Binary types.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
byte[] value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
Use this method for hexBinary or base64Binary types.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
byte[][] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
Use this method for sequences of hexBinary or base64Binary.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
short value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
short[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
int value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
int[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
long value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
long[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
float value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
float[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
double value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
double[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
java.math.BigDecimal value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
java.math.BigDecimal[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
java.math.BigInteger value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
java.math.BigInteger[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
javax.xml.namespace.QName value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
javax.xml.namespace.QName[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
javax.xml.datatype.XMLGregorianCalendar value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
javax.xml.datatype.XMLGregorianCalendar[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
javax.xml.datatype.Duration value)
Bind an atomic value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
javax.xml.datatype.Duration[] values)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The values must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.values - The values for the sequence.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
org.w3c.dom.Node value)
Bind a value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.value - The value of the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
javax.xml.transform.Source source)
Bind a Source object as a value for a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
The source will be parsed and bound as an XItemView (just as if
XItemFactory.item(Source) was called and the result
passed to bind(QName, XItemView)).
- Parameters:
name - The name of the variable.source - The Source object.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bind
void bind(javax.xml.namespace.QName name,
XItemView item)
Bind a single item value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.item - The item to bind to the variable.
- Throws:
java.lang.NullPointerException - if name, or value
is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
bindSequence
void bindSequence(javax.xml.namespace.QName name,
XSequenceCursor sequence)
Bind a sequence value to a variable (XPath, XQuery) or a param (XSLT).
The value must be valid for the type that was specified in the static
context (XPath), in the query (XQuery) or in the stylesheet (XSLT)
for the same name.
- Parameters:
name - The name of the variable.sequence - The sequence to bind to the variable, may be null for an
empty sequence.
- Throws:
java.lang.NullPointerException - if name is null.- See Also:
XStaticContext.declareVariable(QName, QName)
-
removeBinding
void removeBinding(javax.xml.namespace.QName qname)
Remove the binding for the specified variable.
- Parameters:
qname - The name of the variable.
- Throws:
java.lang.NullPointerException - if qname is null.
-
bindFunction
void bindFunction(javax.xml.namespace.QName qname,
java.lang.reflect.Method method)
Bind a function to a name. For static methods only.
Use the version of bindFunction
that takes the instance object as a parameter for instance
methods.
- Parameters:
qname - The name of the function.method - The method.
- Throws:
java.lang.NullPointerException - if qname, or method
is null.- See Also:
bindFunction(QName, Method, Object)
-
bindFunction
void bindFunction(javax.xml.namespace.QName qname,
java.lang.reflect.Method method,
java.lang.Object instanceObject)
Bind a function to a name. The method being bound must be an instance method.
The instanceObject will be used as the object on which to call the method.
- Parameters:
qname - The name of the function.method - The method.instanceObject - The object on which to call the method.
- Throws:
java.lang.NullPointerException - if any of qname, method,
or instanceObject is null.
-
removeFunctionBinding
void removeFunctionBinding(javax.xml.namespace.QName qname,
int arity)
Remove the binding for the specified function.
- Parameters:
qname - The name of the function.arity - The arity of the function. This is the number of parameters
that the function takes. This function for example (removeFunction)
takes 2 parameters so its arity is 2.
- Throws:
java.lang.NullPointerException - if qname is null.
java.lang.IllegalArgumentException - if the arity
-
bindCollation
void bindCollation(java.lang.String uri,
java.util.Locale locale)
Associates the specified collation URI with the
java.text.Collator for the specified
java.util.Locale.
A NullPointerException is thrown if either
argument is null. An IllegalArgumentException
is thrown if uri is a relative URI reference or
is the Unicode code point collation URI.
Calling this method is equivalent to calling
bindCollation(uri, Collator.getInstance(locale))
With the exception of the Unicode code point collation URI,
if a stylesheet, query or XPath expression performs an
operation that requires a collation URI that has not been
bound to a Collator in the XDynamicContext,
the processor will throw an XProcessException.
- Parameters:
uri - A collation URIlocale - The locale whose Collator will be associated with
the specified collation URI
- Throws:
java.lang.IllegalArgumentException - if the URI is not an absolute URI reference
or is the Unicode code point collation URI
java.lang.NullPointerException - if either the URI or the locale is a null
reference- See Also:
XStaticContext.UNICODE_CODE_POINT_COLLATION_URI
-
bindCollation
void bindCollation(java.lang.String uri,
java.text.Collator collator)
Associates the specified collation URI with the specified
java.text.Collator.
A NullPointerException is thrown if either
argument is null. An IllegalArgumentException
is thrown if uri is a relative URI reference or
is the Unicode code point collation URI.
With the exception of the Unicode code point collation URI,
if a stylesheet, query or XPath expression performs an
operation that requires a collation URI that has not been
bound to a Collator in the XDynamicContext,
the processor will throw an XProcessException.
- Parameters:
uri - A collation URIcollator - The Collator that will be associated with
the specified collation URI
- Throws:
java.lang.IllegalArgumentException - if the URI is not an absolute URI reference
or is the Unicode code point collation URI
java.lang.NullPointerException - if either the URI or the locale is a null
reference- See Also:
XStaticContext.UNICODE_CODE_POINT_COLLATION_URI
-
getCollation
java.text.Collator getCollation(java.lang.String uri)
Get the Collator associated with the given
collation URI.
- Parameters:
uri - The collation URI.
- Returns:
- The associated
Collator or null
if no collator has been bound to this the given URI.
- Throws:
java.lang.NullPointerException - if uri is null.
-
removeCollationBinding
void removeCollationBinding(java.lang.String uri)
Remove the Collator associated with the given
collation URI.
- Parameters:
uri - The collation URI.
- Throws:
java.lang.NullPointerException - if uri is null.
-
getImplicitTimeZone
javax.xml.datatype.Duration getImplicitTimeZone()
Get the implicit time zone as a Duration object.
- Returns:
- The implicit time zone or
null if not set.
-
setImplicitTimeZone
void setImplicitTimeZone(javax.xml.datatype.Duration implicitTimeZone)
Sets the implicit time zone. Pass in null for the implicitTimeZone
to restore the default.
- Parameters:
implicitTimeZone - Time zone to be set as a Duration
object or null.
-
setBaseOutputURI
void setBaseOutputURI(java.lang.String uri)
Sets the base URI to use when resolving result documents. Pass in null
for the uri to restore the default. The default is
either the base URI for the primary result document if one is
passed into the execute method or the current working directory.
This setting is XSLT specific.
- Parameters:
uri - The base output URI or null.
-
getBaseOutputURI
java.lang.String getBaseOutputURI()
Get the base output URI.
- Returns:
- The base output URI or
null if not set.
-
setMessageHandler
void setMessageHandler(XMessageHandler handler)
Set a message handler to process dynamic errors and messages. Pass in null for the
handler to restore the default message handling behaviour.
The default is to print messages to System.err and
to also throw an XProcessException for fatal errors.
- Parameters:
handler - The error handler or null.- See Also:
XMessageHandler
-
getMessageHandler
XMessageHandler getMessageHandler()
Get the dynamic message handler.
- Returns:
- The message handler or
null if not set.
-
getSourceResolver
XSourceResolver getSourceResolver()
Get the registered resolver for source documents.
- Returns:
- The registered resolver or
null if there is none.
-
setSourceResolver
void setSourceResolver(XSourceResolver sourceResolver)
Register a resolver for dynamically resolved source documents
such as for the fn:doc function and the XSLT
document function. This source
resolver has no effect on documents that are resolved statically
such as XSLT imports and includes. For these documents the
XStaticContext.setSourceResolver method should be used.
Pass in null for the
sourceResolver to restore the default source lookup
behaviour.
The default source resolution behavior is to interpret relative
URIs in terms of the base URI from the static context
if available or to interpret them as file: paths
relative to the current working directory if the base URI is not
available. Absolute URIs are used unchanged.
- Parameters:
sourceResolver - The source document resolver or null.- See Also:
XSourceResolver
-
getResultResolver
XResultResolver getResultResolver()
Get the registered resolver for result documents.
- Returns:
- The registered resolver or
null if there is none.
-
setResultResolver
void setResultResolver(XResultResolver resultResolver)
Register a resolver for result documents. The resolver will
be invoked when the xsl:result-document instruction
is used in a XSLT stylesheet.
Pass in null for
resultResolver to restore the default result
resolution behaviour.
The default behavior is to use the base output URI to resolve
result documents.
This setting is XSLT specific.
- Parameters:
resultResolver - The result document resolver or null.- See Also:
XResultResolver
-
setFeature
void setFeature(java.lang.String name,
boolean value)
Set a feature for this dynamic context.
Feature names should be fully qualified java.net.URIs.
Implementations may define their own features.
Note: there are no currently defined features, this is for
future use.
- Parameters:
name - Feature name.value - Is feature state true or false.
- Throws:
java.lang.NullPointerException - if name is null.
-
getFeature
boolean getFeature(java.lang.String name)
Get the state of the named feature.
Feature names should be fully qualified java.net.URIs.
Implementations may define their own features.
Note: there are no currently defined features, this is for
future use.
- Parameters:
name - Feature name.
- Returns:
- State of the named feature.
- Throws:
java.lang.NullPointerException - if name is null.
-
setXSLTInitialTemplate
void setXSLTInitialTemplate(javax.xml.namespace.QName initialTemplate)
Specify a named template to use as the initial template
in an XSLT transformation.
If a named template is not set, the initial template is
determined by the initial mode, context node, and template
matching rules
This setting is XSLT specific.
- Parameters:
initialTemplate - The name of the template to use as the
initial template, or null to allow the initial
template to be determined by the template matching rules.
-
getXSLTInitialTemplate
javax.xml.namespace.QName getXSLTInitialTemplate()
Get the name of the initial template.
- Returns:
- The name of the initial template, or
null
if not set.
-
setXSLTInitialMode
void setXSLTInitialMode(javax.xml.namespace.QName initialMode)
Specify a mode to use as the initial mode in an XSLT
transformation.
This setting is XSLT specific.
- Parameters:
initialMode - The name of the initial mode, or null
for the default mode.
-
getXSLTInitialMode
javax.xml.namespace.QName getXSLTInitialMode()
Get the name of the initial mode
- Returns:
- The name of the initial mode, or
null
if not set.
-
getCollectionResolver
XCollectionResolver getCollectionResolver()
Get the registered resolver for collections.
- Returns:
- The
XCollectionResolver if set,
otherwise null.
-
setCollectionResolver
void setCollectionResolver(XCollectionResolver collectionResolver)
Registers a URI resolver for collections.
Pass in null for the collectionResolver
to remove it.
If no collection resolver is registered then calls to fn:collection
will result in a recoverable error and the empty sequence is used
for the collection.
- Parameters:
collectionResolver - The collection resolver or null.- See Also:
XCollectionResolver
-
setUnparsedTextResolver
void setUnparsedTextResolver(XUnparsedTextResolver unparsedTextResolver)
Register a resolver for external resources loaded through the
XSLT unparsed-text function.
Pass in null for the unparsedTextResolver
to restore the default unparsed text lookup behaviour.
The default unparsed text resolution behaviour is to interpret relative
URIs in terms of the base URI from the static context
if available or to interpret them as file: paths
relative to the current working directory if the base URI is not
available. Absolute URIs are used unchanged.
- Parameters:
unparsedTextResolver - The unparsed text resolver or null.- See Also:
XUnparsedTextResolver
-
getUnparsedTextResolver
XUnparsedTextResolver getUnparsedTextResolver()
Get the registered resolver for unparsed text resources.
- Returns:
- The registered resolver or
null if there is none.