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]

problem sorting uniquely w/transform()


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

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