[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Best Practice - collection() function

Subject: RE: Best Practice - collection() function
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 7 Jul 2008 00:13:35 +0100
RE:  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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.