Re: [xsl] Using Saxon 8.5 and collection() to process a directory of XML files

Subject: Re: [xsl] Using Saxon 8.5 and collection() to process a directory of XML files
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 4 Aug 2005 15:57:24 +0100
> You can call saxon:discard-document() to make a document available for
> garbage collection when there are no outstanding references to it.

ah, thanks.

So does that  mean  that one shoudn't make a global variable

  <xsl:variable name="collection" select="collection(...

  <xsl:template name="main">
    <xsl:for-each select="$collection/saxon:discard-document(.)" ...


as that will force you to keep the document around forever in case I go 
$collection[66]/a/b/c at some strange point? Or can your stylesheet
analysis detect that the variable is only used in a top level loop?


Should I instead go


  <xsl:template name="main">
  <xsl:for-each select="collection( ...)/saxon:discard-document(.)"



so that outside the loop the node is not accessible (without reparsing
the document)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread