Collection URIs

The default collection can be registered with the Java Processor or C# Processor (or with its underlying Configuration) by setting the configuration feature DEFAULT_COLLECTION. The value takes the form of a collection URI. When the collection() or uri-collection() function is called with no arguments, or when the supplied argument is an empty sequence, this is exactly the same as supplying this default collection URI. If no default collection URI has been registered, the function raises error FODC0002.

Before the collection URI is passed to the collection finder, it is processed as follows. First it is validated as a URI using the relevant built-in Java or C# mechanisms. If validation fails, another attempt is made after applying the iri-to-uri() function (this is particularly useful if the collection URI includes a query part containing a regular expression, as this will often need to be percent-encoded). If the resulting URI is relative, it is then resolved against the static base URI.

The standard collection finder supports four different kinds of collection: registered collections, catalog-based collections, directory-based collections, and (on Java only) zip-based collections:

Saxon by default recognizes four kids of resource: XML documents, JSON documents, unparsed text documents, and binary files. The standard collection resolver attempts to identify which kind of resource to use based on the content type (media type), which in turn may be inferred from HTTP headers, from sniffing the initial bytes of the content, or from file extensions.

In the case of directory-based and ZIP-based collections, query parameters may be added to the collection URI to further control how it is to be processed.