Package org.eclipse.wst.xml.xpath2.api


org.eclipse.wst.xml.xpath2.api
Class DynamicContext



public class DynamicContext
extends 
Interface for dynamic context. This covers the Dynamic Context as defined by the XPath2 specification, EXCEPT for context item and size (handled in EvaluationContext)


Method Summary

public org.eclipse.wst.xml.xpath2.api.CollationProvidergetCollationProvider()
     Actual collation providers available for use dynamically. This could differ from the collations available statically, but would give unexpected results.
public java.util.MapgetCollections()
     [Definition: Available collections. This is a mapping of strings onto sequences of nodes. The string represents the absolute URI of a resource. The sequence of nodes represents the result of the fn:collection function when that URI is supplied as the argument. ] The set of available collections is not limited to the set of statically known collections, and it may be empty. For every document node D that is in the target of a mapping in available collections, or that is the root of a tree containing such a node, the document-uri property of D must either be absent, or must be a URI U such that available documents contains a mapping from U to D." Note: This means that for any document node $N retrieved using the fn:collection function, either directly or by navigating to the root of a node that was returned, the result of fn:doc(fn:document-uri($N)) is $N will always be True, unless fn:document-uri($N) is an empty sequence. This implies a requirement for the fn:doc and fn:collection functions to be consistent in their effect. If the implementation uses catalogs or user-supplied URI resolvers to dereference URIs supplied to the fn:doc function, the implementation of the fn:collection function must take these mechanisms into account. For example, an implementation might achieve this by mapping the collection URI to a set of document URIs, which are then resolved using the same catalog or URI resolver that is used by the fn:doc function.
public java.util.GregorianCalendargetCurrentDateTime()
     [Definition: Current dateTime. This information represents an implementation-dependent point in time during the processing of an expression, and includes an explicit timezone. It can be retrieved by the fn:current-dateTime function. If invoked multiple times during the execution of an expression, this function always returns the same result.] Returns the current date time using the GregorianCalendar.
public java.util.ListgetDefaultCollection()
     [Definition: Default collection. This is the sequence of nodes that would result from calling the fn:collection function with no arguments.] The value of default collection may be initialized by the implementation.
public org.w3c.dom.DocumentgetDocument(java.net.URI uri)
     [Definition: Available documents. This is a mapping of strings onto document nodes. The string represents the absolute URI of a resource. The document node is the root of a tree that represents that resource using the data model. The document node is returned by the fn:doc function when applied to that URI.] The set of available documents is not limited to the set of statically known documents, and it may be empty. If there are one or more URIs in available documents that map to a document node D, then the document-uri property of D must either be absent, or must be one of these URIs. Note: This means that given a document node $N, the result of fn:doc(fn:document-uri($N)) is $N will always be True, unless fn:document-uri($N) is an empty sequence.
public org.w3c.dom.NodegetLimitNode()
     Returns a "top" node which the XPath2 engine is not allowed to leave
public javax.xml.datatype.DurationgetTimezoneOffset()
     [Definition: Implicit timezone. This is the timezone to be used when a date, time, or dateTime value that does not have a timezone is used in a comparison or arithmetic operation. The implicit timezone is an implementation-defined value of type xs:dayTimeDuration. See [XML Schema] for the range of legal values of a timezone.]
public org.eclipse.wst.xml.xpath2.api.ResultSequencegetVariable(javax.xml.namespace.QName name)
     Get variable.
public java.net.URIresolveUri(java.lang.String uri)
     Resolve an URI

Methods Detail

getCollationProvider

public org.eclipse.wst.xml.xpath2.api.CollationProvider getCollationProvider()

Actual collation providers available for use dynamically. This could differ from the collations available statically, but would give unexpected results.

Returns

org.eclipse.wst.xml.xpath2.api.CollationProvider


getCollections

public java.util.Map getCollections()

[Definition: Available collections. This is a mapping of strings onto sequences of nodes. The string represents the absolute URI of a resource. The sequence of nodes represents the result of the fn:collection function when that URI is supplied as the argument. ] The set of available collections is not limited to the set of statically known collections, and it may be empty. For every document node D that is in the target of a mapping in available collections, or that is the root of a tree containing such a node, the document-uri property of D must either be absent, or must be a URI U such that available documents contains a mapping from U to D." Note: This means that for any document node $N retrieved using the fn:collection function, either directly or by navigating to the root of a node that was returned, the result of fn:doc(fn:document-uri($N)) is $N will always be True, unless fn:document-uri($N) is an empty sequence. This implies a requirement for the fn:doc and fn:collection functions to be consistent in their effect. If the implementation uses catalogs or user-supplied URI resolvers to dereference URIs supplied to the fn:doc function, the implementation of the fn:collection function must take these mechanisms into account. For example, an implementation might achieve this by mapping the collection URI to a set of document URIs, which are then resolved using the same catalog or URI resolver that is used by the fn:doc function.

Returns

java.util.Map


getCurrentDateTime

public java.util.GregorianCalendar getCurrentDateTime()

[Definition: Current dateTime. This information represents an implementation-dependent point in time during the processing of an expression, and includes an explicit timezone. It can be retrieved by the fn:current-dateTime function. If invoked multiple times during the execution of an expression, this function always returns the same result.] Returns the current date time using the GregorianCalendar.

Returns

java.util.GregorianCalendar - The current date and time, which will always be same for the dynamic context.


getDefaultCollection

public java.util.List getDefaultCollection()

[Definition: Default collection. This is the sequence of nodes that would result from calling the fn:collection function with no arguments.] The value of default collection may be initialized by the implementation.

Returns

java.util.List


getDocument

public org.w3c.dom.Document getDocument(java.net.URI uri)

[Definition: Available documents. This is a mapping of strings onto document nodes. The string represents the absolute URI of a resource. The document node is the root of a tree that represents that resource using the data model. The document node is returned by the fn:doc function when applied to that URI.] The set of available documents is not limited to the set of statically known documents, and it may be empty. If there are one or more URIs in available documents that map to a document node D, then the document-uri property of D must either be absent, or must be one of these URIs. Note: This means that given a document node $N, the result of fn:doc(fn:document-uri($N)) is $N will always be True, unless fn:document-uri($N) is an empty sequence.

Parameters

uri - is the URI of the document.

Returns

org.w3c.dom.Document - document.


getLimitNode

public org.w3c.dom.Node getLimitNode()

Returns a "top" node which the XPath2 engine is not allowed to leave

Returns

org.w3c.dom.Node - DOM node which limits axis navigation.


getTimezoneOffset

public javax.xml.datatype.Duration getTimezoneOffset()

[Definition: Implicit timezone. This is the timezone to be used when a date, time, or dateTime value that does not have a timezone is used in a comparison or arithmetic operation. The implicit timezone is an implementation-defined value of type xs:dayTimeDuration. See [XML Schema] for the range of legal values of a timezone.]

Returns

javax.xml.datatype.Duration - current date time and implicit timezone.


getVariable

public org.eclipse.wst.xml.xpath2.api.ResultSequence getVariable(javax.xml.namespace.QName name)

Get variable.

Parameters

name - is the name of the variable.

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - variable.


resolveUri

public java.net.URI resolveUri(java.lang.String uri)

Resolve an URI

Parameters

uri - is the possibly relative URI to resolve

Returns

java.net.URI - the absolutized, resolved URI.