xsl-list
[Top] [All Lists]

Re: RE: [xsl] Best Practice - collection() function

2008-07-07 04:28:58
Thank you Michael and Andrew,

I am using Saxon 9.06 - 

Question - I am using keys to provide cross referencing for the index. Since 
the keys are declared as a child of <xsl:stylesheet>, when I call a 
collection(), is the key over written or does the key continue to hold all the 
information in memory?

Thanks 

From: Michael Kay <mike(_at_)saxonica(_dot_)com>
Date: 2008/07/06 Sun PM 06:13:35 CDT
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Best Practice - collection() function


I use the collection function to generate a single FO file 
for PDF output.
There are several times I use the collection function to 
output different information for the FO (table of contents, 
index). Everything works as expected, but it becomes highly 
inefficient when I use the collection function on the same 
folder 3 times. 

For example, I would use the collection(file:///c:/folder) 3 
times in my
xslt:

* to build a TOC
* to build a Index
* Build chapters in a book.

Because I have to build my FO with page sequences, I end up 
calling the same 800 xml files 3 times. Is there a way to do 
this more efficiently?

The implementation of the collection() function is likely to vary from one
product to another - one can't generalize about it's caching behaviour
without knowing which product you are talking about.

If you want to maximize the chances that the result of the collection()
function is held in memory, so that multiple calls with the same URI don't
re-read the individual files, then it would be best to put the result in a
variable.

I think that Saxon will re-read the directory contents on each call, but
will cache the individual documents.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--