The obvious approach is to use a for-each loop that includes a variable
that
opens the external file using a document() call. The problem is that the
process inevitably runs out of memory, both with Saxon and Xalan. It
seems
that the variables are passing out of scope and being destroyed as they
should, but I gather from a posting by Michael Kay
(http://www.biglist.com/lists/xsl-list/archives/200212/msg00507.html)
that
all of those document() source trees are remaining in memory throughout
the
transformation, adding up to megabytes of data.
Can anyone suggest a strategy? The process doesn't have to be fast, it
just
has to finish.
Xalan has a feature to turn off caching, but doing so will interfere with
guarantees of generate-id() and the document() function.
The feature is detailed here:
http://xml.apache.org/xalan-j/faq.html#faq-N102AE
The compliance feature that is broken is detailed here:
http://www.w3.org/TR/xslt#document
"Two documents are treated as the same document if they are identified
by the same URI. The URI used for the comparison is the absolute URI
into which any relative URI was resolved and does not include any
fragment identifier. One root node is treated as the same node as
another root node if the two nodes are from the same document. Thus, the
following expression will always be true:
generate-id(document("foo.xml"))=generate-id(document("foo.xml"))"
Dave
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list