Writing a URI Resolver for Collections

Saxon 9.7 introduced a new CollectionFinder interface, superseding the older CollectionURIResolver (which has been dropped in Saxon 10). The new mechanism was needed in response to changes in XPath 3.1 that allowed a collection to return any kind of values, not only XML documents. For example a collection might include JSON documents, unparsed text files, or binary files.

The built-in CollectionFinder supports several ways of defining collections (they can be mapped to directories, JAR/ZIP files, or lists of files in a catalog), and media types for recognizing XML files, text files, JSON files, and binary files. The mechanisms are highly configurable and APIs are provided to define new kinds of collection and new media types.

For details of the behavior of the standard collection finder, and more information on supplying your own, see Collections.