net.sf.saxon.dotnet
Class DotNetCollectionURIResolver

java.lang.Object
  extended by net.sf.saxon.functions.StandardCollectionURIResolver
      extended by net.sf.saxon.dotnet.DotNetCollectionURIResolver
All Implemented Interfaces:
java.io.Serializable, CollectionURIResolver

public class DotNetCollectionURIResolver
extends StandardCollectionURIResolver

This class implements the CollectionURIResolver interface by wrapping an IEnumerable which returns Uri values (the URIs of the documents in the collection)

See Also:
Serialized Form

Constructor Summary
DotNetCollectionURIResolver()
           
 
Method Summary
 void registerCollection(java.lang.String uri, IEnumerable enumerable)
           
 SequenceIterator resolve(java.lang.String href, java.lang.String base, XPathContext context)
          Resolve a URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotNetCollectionURIResolver

public DotNetCollectionURIResolver()
Method Detail

registerCollection

public void registerCollection(java.lang.String uri,
                               IEnumerable enumerable)

resolve

public SequenceIterator resolve(java.lang.String href,
                                java.lang.String base,
                                XPathContext context)
                         throws XPathException
Resolve a URI.

Specified by:
resolve in interface CollectionURIResolver
Overrides:
resolve in class StandardCollectionURIResolver
Parameters:
href - The relative URI of the collection. This corresponds to the argument supplied to the collection() function. If the collection() function was called with no arguments (to get the "default collection") this argument will be null.
base - The base URI that should be used. This is the base URI of the static context in which the call to collection() was made, typically the URI of the stylesheet or query module
context - The dynamic execution context
Returns:
an Iterator over the documents in the collection. The items returned by this iterator must be instances either of xs:anyURI, or of node() (specifically, NodeInfo.). If xs:anyURI values are returned, the corresponding document will be retrieved as if by a call to the doc() function: this means that the system first checks to see if the document is already loaded, and if not, calls the registered URIResolver to dereference the URI. This is the recommended approach to ensure that the resulting collection is stable: however, it has the consequence that the documents will by default remain in memory for the duration of the query or transformation.

If the URI is not recognized, the method may either return an empty iterator, in which case no error is reported, or it may throw an exception, in which case the query or transformation fails. Returning null has the same effect as returning an empty iterator.

Throws:
XPathException