Subject: Re: [xsl] how to break down a large XML file in small chunks From: David Carlisle <davidc@xxxxxxxxx> Date: Sat, 31 Jul 2004 20:05:50 +0100 |
<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 ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] how to break down a large XML, juan valentín-pastra | Thread | [xsl] variablescounting, mankar |
[xsl] variablescounting, mankar | Date | [xsl] posting, mankar |
Month |