Subject: RE: [xsl] Chunking xml into single-topic docs From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Fri, 25 Feb 2005 23:06:29 -0000 |
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.kessler@xxxxxx] > Sent: 25 February 2005 21:41 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Chunking xml into single-, JBryant | Thread | [xsl] Using attributes and elements, António Mota |
Re: [xsl] Chunking xml into single-, JBryant | Date | Re: [xsl] Maths functions in a styl, Karl Stubsjoen |
Month |