This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problems calling template from within sorted <xsl:for-each> loop.


> Thanks Micheal. That's an awesome solution!
> 
> I can see how it works, although I am slightly confused with 
> the first <xsl:for-each>. Is the sort performed before the 
> select is evaluated? otherwise you could have duplicates in 
> the group node-list.
> 
> <xsl:for-each select="rule[not(@decision-num = 
> preceding-sibling::rule/@decision-num)]">
>   <xsl:sort select="@decision-num ... descending...
> 

This is the standard way of eliminating duplicates: it selects all the
rule elements whose @decision-num is different from that of all the
preceding rules. (Note that preceding-sibling selects all preceding
siblings, not just the immediately preceding one).

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]