xsl-list
[Top] [All Lists]

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

2008-07-07 05:16:54
On Mon, 2008-07-07 at 12:55 +0100, Michael Kay wrote:

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?


An index is constructed for a given document the first time the key()
function is used to search that document. The index will be held in memory
so long as both the compiled stylesheet and the document tree are in memory.


In jaxp terms, is the compiled stylesheet the (javax.xml.transform.)
Templates or the Transformer object?

And for the document tree, that would exist just for the duration of the
transformation, right?

thanks,
-Rob


In the case of collection(), if you don't use saxon:discard-document(), the
document tree is held in memory until the end of the transformation. In
fact, if I remember correctly, saxon:discard-document() has no effect if
there are indexes for the document in memory [but I need to check that].

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>
--~--