Writing a URI Resolver for Collections

Saxon 9.7 introduced a new CollectionFinder interface, superseding the older CollectionURIResolver. 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.

The old CollectionURIResolver interface is retained for backwards compatibility.