xsl-list
[Top] [All Lists]

RE: Re: Key and/or grouping questions.

2002-12-06 02:42:56
I think a better approach would be to restructure your code 
to use the
usual:

<xsl:for-each select="xx[position() mod $size = 1]">
  ..
  <xsl:for-each select=".|following-sibling[position() 
&lt;= $size]">

Trying something similar to the nested for-each, excpet my 
outer for-each is somthing similar to the following: 

   <xsl:for-each select="xx[position() = $startPos]">

I get the line at the starting postion just fine, but I get 
none of the following-sibling elements.  If the outer loop 
selects one element (or even every nth element), are the 
elements selected by the outer loop going to have siblings 
other than those selected by the outer loop; I'm guessing 
not.  I suspect the inner loop in the algorithm above is 
going to process a number nodes equal to $size, but those 
nodes will be every nth element from the xx where n = $size.

I was guessing at you input document structure, because I don't think
you showed us what it looked like. Perhaps the elements you are looking
for are not actually siblings of each other.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>