[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Chunking xml into single-topic docs
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: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|