I have some XSL files that work through all the files in a directory recurively, basically it reads in a variable called collection:
<xsl:variable name="collection">
<xsl:copy-of select="collection(iri-to-uri('./?select=*.xml;recurse=yes'))/*"/>
</xsl:variable>
and then later on, we have something like:
<xsl:for-each-group select="$collection/configuration/services/service" group-by="serviceKey" >
This was fine for a while but now I want to pass in alist of files that would make up the variable collection. Im working with java so I caneffectively pass in a comma delimined list of files paths or URI's, but I'm not sure how to handle that in the XSL file, so that it populates the collection variable like the recursive iri-to-uri function was working.
Another solution would be to implement a CollectionURIResolver in your Java application. You can nominate this to Saxon before running your transformation. When you call the collection() function, Saxon will call your CollectionURIResolver, which can pass back a list of documents or URIs.
http://www.saxonica.com/documentation/index.html#!javadoc/net.sf.saxon.lib/CollectionURIResolver