|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: how to break down a large XML file in small chunks
<xsl:for-each select="/xml/instances/instance"> <xsl:if test="(position() >= $firstcount) and (position() <= That is going through the whole lot each time,throwing most away. Instead of passing in counters pass in the first node you want <xsl:with-param name="firstnode" select="."/> Then inside the template you cust need for-each select="$firstnode|$firstnode/following-sibling::*[position()<$maxline"/> if you are passing numbers, don't do <xsl:variable name="totalines"><xsl:value-of select="count(/xml/instances/instance)" /></xsl:variable> or <xsl:with-param name="firstcount"><xsl:value-of select="position()" /></xsl:with-param> as that makes a result tree fragment with a document node containing a text node with string value the decimal representation of the number which isn't particularly efficient. just do <xsl:variable name="totalines" select="count(/xml/instances/instance)" /> <xsl:with-param name="firstcount" select="position()" /> which makes them numbers. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. 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 ________________________________________________________________________
|
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
|






