If your logic is as simple as
<xsl:for-each select="chapter">
<xsl:result-document href="chap{position()}">
<xsl:apply-templates/>
</xsl:result-document>
</xsl:for-each>
then I would definitely use position() - it's easy to express and easy for
the processor to calculate.
Using things like <xsl:number/> or count(preceding-sibling::*) is sometimes
necessary but it has a serious risk of being O(n^2) in performance
(depending of course on the optimizer).
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Kessler, Marcy [mailto:marcy(_dot_)kessler(_at_)hp(_dot_)com]
Sent: 25 February 2005 21:41
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Chunking xml into single-topic docs
To All:
Thank you for the help. To clarify, I actually want to create unique
file names by attaching a number to each file created. Is the best
method for doing this <xsl:count> as both David and Jay suggested?
Michael, would your suggestion of using something like
href="chap{position()}" be a better way to go. If so, why?
(being new to the list, I hope that applying to the list from
the digest
follows my original thread correctly - apologies for being a newbie on
all fronts ;) )
Thanks again!
Regards,
Marcy
--~------------------------------------------------------------------
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>
--~--