I’m using Instant Saxon (thus XSL 1.1) to create an output document with the following structure:


            f(entire input document)

            f(subset 1 of input document)

            f(subset 2 of input document)


            f(subset n of input document)


My input documents will be very large (1GB+ in some cases), as will some of the subsets.


What is the best way to pass the subset information to the template that implements f? Passing a node-set seems to be the most natural way, but I’m concerned about performance and memory consumption. Passing an XPath expression as a string and letting f do a saxon:evaluate() is another option. However, I suspect that with this option, my memory consumption will be the same as in the node-set case (unless passing a node-set creates an extra copy of the data).


Do you think one of these options is my best approach? Are there smarter options I should be considering?


Thank you very much.


Cary Millsap