net.sf.saxon.xqj
Class SaxonXQDynamicContext

java.lang.Object
  extended by net.sf.saxon.xqj.Closable
      extended by net.sf.saxon.xqj.SaxonXQDynamicContext
All Implemented Interfaces:
javax.xml.xquery.XQDynamicContext
Direct Known Subclasses:
SaxonXQExpression, SaxonXQPreparedExpression

public abstract class SaxonXQDynamicContext
extends Closable
implements javax.xml.xquery.XQDynamicContext

Saxon implementation of the XQJ DynamicContext interface


Field Summary
protected  SaxonXQConnection connection
           
 
Constructor Summary
SaxonXQDynamicContext()
           
 
Method Summary
 void bindAtomicValue(QName varname, String value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindBoolean(QName varname, boolean value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindByte(QName varname, byte value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindDocument(QName varname, InputStream value, String baseURI, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindDocument(QName varname, Reader value, String baseURI, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindDocument(QName varname, Source value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item from the given Source.
 void bindDocument(QName varname, String value, String baseURI, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindDocument(QName varname, javax.xml.stream.XMLStreamReader value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindDouble(QName varname, double value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindFloat(QName varname, float value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindInt(QName varname, int value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindItem(QName varname, javax.xml.xquery.XQItem value)
          Binds a value to the given external variable.
 void bindLong(QName varname, long value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindNode(QName varname, Node value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindObject(QName varname, Object value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindSequence(QName varname, javax.xml.xquery.XQSequence value)
          Binds a value to the given external variable or the context item.
 void bindShort(QName varname, short value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
 void bindString(QName varname, String value, javax.xml.xquery.XQItemType type)
          Binds a value to the given external variable or the context item.
protected abstract  boolean externalVariableExists(QName name)
           
protected  Configuration getConfiguration()
           
protected abstract  SaxonXQDataFactory getDataFactory()
           
protected abstract  DynamicQueryContext getDynamicContext()
           
 TimeZone getImplicitTimeZone()
          Gets the implicit timezone
 void setImplicitTimeZone(TimeZone implicitTimeZone)
          Sets the implicit timezone
 
Methods inherited from class net.sf.saxon.xqj.Closable
close, isClosed, setClosableContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected SaxonXQConnection connection
Constructor Detail

SaxonXQDynamicContext

public SaxonXQDynamicContext()
Method Detail

getDynamicContext

protected abstract DynamicQueryContext getDynamicContext()

getConfiguration

protected final Configuration getConfiguration()

getDataFactory

protected abstract SaxonXQDataFactory getDataFactory()
                                              throws javax.xml.xquery.XQException
Throws:
javax.xml.xquery.XQException

externalVariableExists

protected abstract boolean externalVariableExists(QName name)

bindAtomicValue

public void bindAtomicValue(QName varname,
                            String value,
                            javax.xml.xquery.XQItemType type)
                     throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the casting from xs:string rules outlined in 17.1.1 Casting from xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators. If the cast fails, or if there is a mismatch between the static and dynamic types, an XQException is thrown either by this method or during query evaluation.

Specified by:
bindAtomicValue in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to
value - the lexical string value of the type
type - the item type of the bind
Throws:
javax.xml.xquery.XQException - if (1) any of the arguments are null, (2) given type is not an atomic type, (3) the conversion of the value to an XDM instance failed, (4) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (5) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (6) the expression is in a closed state

bindBoolean

public void bindBoolean(QName varname,
                        boolean value,
                        javax.xml.xquery.XQItemType type)
                 throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindBoolean in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindByte

public void bindByte(QName varname,
                     byte value,
                     javax.xml.xquery.XQItemType type)
              throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindByte in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindDocument

public void bindDocument(QName varname,
                         InputStream value,
                         String baseURI,
                         javax.xml.xquery.XQItemType type)
                  throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Specified by:
bindDocument in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindDocument

public void bindDocument(QName varname,
                         Reader value,
                         String baseURI,
                         javax.xml.xquery.XQItemType type)
                  throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Specified by:
bindDocument in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindDocument

public void bindDocument(QName varname,
                         Source value,
                         javax.xml.xquery.XQItemType type)
                  throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item from the given Source. An XQJ implementation must at least support the following implementations:

If the value represents a well-formed XML document, it will result in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindDocument in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindDocument

public void bindDocument(QName varname,
                         String value,
                         String baseURI,
                         javax.xml.xquery.XQItemType type)
                  throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item.

If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.

Specified by:
bindDocument in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindDocument

public void bindDocument(QName varname,
                         javax.xml.stream.XMLStreamReader value,
                         javax.xml.xquery.XQItemType type)
                  throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item.

If the value represents a well-formed XML document, it results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.

The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.

If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindDocument in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindDouble

public void bindDouble(QName varname,
                       double value,
                       javax.xml.xquery.XQItemType type)
                throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluations.

Specified by:
bindDouble in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindFloat

public void bindFloat(QName varname,
                      float value,
                      javax.xml.xquery.XQItemType type)
               throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluations.

Specified by:
bindFloat in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindInt

public void bindInt(QName varname,
                    int value,
                    javax.xml.xquery.XQItemType type)
             throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluations.

Specified by:
bindInt in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindItem

public void bindItem(QName varname,
                     javax.xml.xquery.XQItem value)
              throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable. The dynamic type of the value is derived from the XQItem. In case of a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindItem in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be bound, cannot be null
Throws:
javax.xml.xquery.XQException - if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed

bindLong

public void bindLong(QName varname,
                     long value,
                     javax.xml.xquery.XQItemType type)
              throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindLong in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindNode

public void bindNode(QName varname,
                     Node value,
                     javax.xml.xquery.XQItemType type)
              throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindNode in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindObject

public void bindObject(QName varname,
                       Object value,
                       javax.xml.xquery.XQItemType type)
                throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindObject in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindSequence

public void bindSequence(QName varname,
                         javax.xml.xquery.XQSequence value)
                  throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The input sequence is consumed from its current position to the end, after which the input sequence's position will be set to point after the last item. The dynamic type of the value is derived from the items in the sequence. In case of a mismatch between the static and dynamic types, an XQException is be raised either by this method, or during query evaluation.

Specified by:
bindSequence in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be bound, cannot be null
Throws:
javax.xml.xquery.XQException - if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified sequence is closed

bindShort

public void bindShort(QName varname,
                      short value,
                      javax.xml.xquery.XQItemType type)
               throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindShort in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted
type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

bindString

public void bindString(QName varname,
                       String value,
                       javax.xml.xquery.XQItemType type)
                throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Binds a value to the given external variable or the context item. The value is converted into an instance of the specified type, which must represent an xs:string or a type derived by restriction from xs:string. If the specified type is null, it defaults to xs:string.
Subsequently the value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0,. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.

Specified by:
bindString in interface javax.xml.xquery.XQDynamicContext
Parameters:
varname - the name of the external variable to bind to, cannot be null
value - the value to be converted, cannot be null
type - the type of the value to be bound to the external variable. The default type, xs:string, is used in case null is specified
Throws:
javax.xml.xquery.XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state

getImplicitTimeZone

public TimeZone getImplicitTimeZone()
                             throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Gets the implicit timezone

Specified by:
getImplicitTimeZone in interface javax.xml.xquery.XQDynamicContext
Returns:
the implicit timezone. This may have been set by an application using the setImplicitTimeZone method or provided by the implementation
Throws:
javax.xml.xquery.XQException - if the expression is in a closed state

setImplicitTimeZone

public void setImplicitTimeZone(TimeZone implicitTimeZone)
                         throws javax.xml.xquery.XQException
Description copied from interface: javax.xml.xquery.XQDynamicContext
Sets the implicit timezone

Specified by:
setImplicitTimeZone in interface javax.xml.xquery.XQDynamicContext
Parameters:
implicitTimeZone - time zone to be set
Throws:
javax.xml.xquery.XQException - if the expression is in a closed state


Copyright (c) Saxonica Limited. All rights reserved.