[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Chunking xml into single-topic docs

Subject: RE: Chunking xml into single-topic docs
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 25 Feb 2005 23:06:29 -0000
chunking xml
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.