|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.functions.StandardCollectionURIResolver
This class implements the default collection URI Resolver.
This supports two implementations of collections. If the URI supplied uses the "file:/" scheme, and the file that is referenced is a directory, then the collection is the set of files in that directory. Query parameters may be included in the URI:
recurse=yes|no controls whether the directory is scanned recursively;
strip=yes|no determines whether whitespace text nodes are stripped from the selected documents;
val=strict|lax|preserve|strip determines whether schema validation is applied;
select=pattern determines which files in the directory are selected.
onerror=fail|warn|ignore determines the action taken if processing of a file fails
parser=qualified.class.name selects the parser (XMLReader) to be used to read the files
Otherwise, the resolver attempts to dereference the URI to obtain a catalog file. This is an XML file containing a list of documents, in the format:
<collection> <doc href="doc1.xml"/> <doc href="doc2.xml"/> </collection>
Constructor Summary | |
StandardCollectionURIResolver()
|
Method Summary | |
java.lang.Object |
map(Item item,
XPathContext context)
Map from doc elements in the catalogue document to nodes returned in the result |
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 |
public StandardCollectionURIResolver()
Method Detail |
public SequenceIterator resolve(java.lang.String href, java.lang.String base, XPathContext context) throws XPathException
resolve
in interface CollectionURIResolver
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 modulecontext
- The dynamic execution context
NodeInfo
interface.
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.
XPathException
public java.lang.Object map(Item item, XPathContext context) throws XPathException
map
in interface MappingFunction
item
- A doc element in the catalogue documentcontext
- The dynamic evaluation context
XPathException
- if the document cannot be retrieved or parsed, unless
error recovery has been chosen.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |