This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
problem sorting uniquely w/transform()
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: problem sorting uniquely w/transform()
- From: Shane Knapp <SKNAPP at LIVEMIND dot COM>
- Date: Wed, 6 Sep 2000 13:23:25 -0700
- Reply-To: xsl-list at mulberrytech dot com
i am having a problem sorting uniquely on an element name... i'm
translating the <LEAGUE NAME="..."> element to uppercase and seeing if it
matches any preceding elements.
it works, however, if i *don't* do the translation.
so, here's a chunk of the xslt:
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="/">
<catalog>
<xsl:for-each
select="//LEAGUE[not(translate(@NAME,$lower,$upper)=translate(preceding::*/@
NAME,$lower,$upper))]">
<!-- <xsl:for-each
select="//LEAGUE[not(@NAME=preceding::*/@NAME)]"> for some reason, this
works-->
<xsl:sort select="@NAME"/>
<!-- do stuff -->
</xsl:for-each>
</catalog>
</xsl:template>
and here's what the data looks like:
<SCORES>
<LEAGUE NAME="mlb">
</LEAGUE>
</SCORES>
i'm using XT for processing (hence no keys).
thanks in advance!
shane
--
Shane Knapp
Wireless Platform Engineer
LiveMind, Inc
415.861.0394
www.livemind.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list