This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Problems calling template from within sorted <xsl:for-each> loop.
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 17 Jun 2002 14:44:00 +0100
- Subject: RE: [xsl] Problems calling template from within sorted <xsl:for-each> loop.
- Reply-to: xsl-list at lists dot mulberrytech dot com
> 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