Subject: Re: [xsl] recursive counter not incrementing From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 8 Dec 2004 22:41:37 GMT |
It's not clear why you are using recursion rather than just using postion() or count to get this number, but perhaps that's just because you have cut the example down, I didn't follow all the logic of your stylesheet but can comment on some lines: <xsl:with-param name="s1" select="$s1/item[following-sibling]"/> That selects all items that have a child called following-sibling so it will be empty, I don't know which nodes you mean to select here but perhaps select="following-sibling::*" <xsl:for-each select="$s1/item"> <xsl:variable name="sub1" select="."/> <xsl:for-each select="$s2/item"> <xsl:if test="$sub1 = . "> This is rather strange, it loops through all pairs of items in s1 and s1 but only does anything if the items are equal so you could just select those pairs with a single xpath: <xs:for-each select="$s2/item[.=$s1/item]"> which is more compact to write and at least gives the system a chance of being a bit more efficient. It seems that you want to use an integer counter as your main control and repeatedly pass the whole of yor set $s1 and keep accessing $s1[$i] this isn't the usual XSL way, normally you would just simply pass the current node as a parameter, and then move control to teh following sibling, without ever needing your integer position variable. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. 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 -> |
---|---|---|
Re: [xsl] recursive counter not inc, Wendell Piez | Thread | Re: [xsl] recursive counter not inc, Christopher Hansen |
[xsl] recursive counter not increme, Christopher Hansen | Date | Re: [xsl] computed <xsl:apply-templ, Kevin Rodgers |
Month |