Re: [xsl] Tutorial for collection()

Subject: Re: [xsl] Tutorial for collection()
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 17 May 2007 15:57:32 +0100
On 5/17/07, Jesper Tverskov <jesper@xxxxxxxxxxx> wrote:
As a follow-up to "the collection() function" thread,
http://www.biglist.com/lists/xsl-list/archives/200705/msg00369.html

I have made a tutorial for how to use the collection() function in XSLT 2.0:

"Collection() and REGEX in XSLT",
http://www.xmlplease.com/collection

You dont need the xpath for construct "for $x in ... return $x":


<xsl:for-each select="for $x in
collection('file:///c:/someDir/?select=*.*') return $x">

as it's equivalent to:

<xsl:for-each select="collection('file:///c:/someDir/?select=*.*')">

...unless you're using saxon:discard-document(), which frees up the
memory after the document is processed (if your collection is large
you quickly run out of memory):

http://ajwelch.blogspot.com/2006/11/using-collection-and-saxondiscard.html

cheers
andrew

Current Thread