01: package net.sf.saxon;
02:
03: import net.sf.saxon.expr.XPathContext;
04: import net.sf.saxon.om.SequenceIterator;
05: import net.sf.saxon.trans.XPathException;
06:
07: import java.io.Serializable;
08:
09: /**
10: * This interface defines a CollectionURIResolver. This is a counterpart to the JAXP
11: * URIResolver, but is used to map the URI of collection into a sequence of documents
12: * @author Michael H. Kay
13: */
14:
15: public interface CollectionURIResolver extends Serializable {
16:
17: /**
18: * Resolve a URI.
19: * @param href The relative URI of the collection. This corresponds to the
20: * argument supplied to the collection() function. If the collection() function
21: * was called with no arguments (to get the "default collection") this argument
22: * will be null.
23: * @param base The base URI that should be used. This is the base URI of the
24: * static context in which the call to collection() was made, typically the URI
25: * of the stylesheet or query module
26: * @param context The dynamic execution context
27: * @return an Iterator over the documents in the collection. The items returned
28: * by this iterator must be instances of {@link net.sf.saxon.om.NodeInfo}.
29: * <p>
30: * If the URI is not recognized, the method may either return an empty iterator,
31: * in which case no error is reported, or it may throw an exception, in which case
32: * the query or transformation fails. Returning null has the same effect as returning
33: * an empty iterator.
34: */
35:
36: public SequenceIterator resolve(String href, String base,
37: XPathContext context) throws XPathException;
38:
39: }
40:
41: //
42: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
43: // you may not use this file except in compliance with the License. You may obtain a copy of the
44: // License at http://www.mozilla.org/MPL/
45: //
46: // Software distributed under the License is distributed on an "AS IS" basis,
47: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
48: // See the License for the specific language governing rights and limitations under the License.
49: //
50: // The Original Code is: all this file.
51: //
52: // The Initial Developer of the Original Code is Michael H. Kay
53: //
54: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
55: //
56: // Contributor(s): none.
57: //
|