[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Selecting case insensitively


Subject: Re: Selecting case insensitively
From: Michal_Mart@xxxxxxxxxxx
Date: Tue, 15 Aug 2000 15:44:47 -0400


Hi,
I tried to get "insensitively" unique records from a list and I failed,  what am
I missing?
Based on the FAQ http://www.dpawson.freeserve.co.uk/xsl/N2696.html#N8679 and
Jeni's http://sources.redhat.com/ml/xsl-list/2000-08/msg00787.html I wrote the
following:

********* xml file ****************
<location>
   <state>xxxx</state>
 </location>

 <location>
    <state>yyyy</state>
 </location>

  <location>
    <state>xxxx</state>
 </location>

  <location>
    <state>xxXx</state>
 </location>
********* end xml file ***********

********* xsl file ****************
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />

<xsl:template match="/">

     <xsl:variable name="unique-list"

select="Test/location/state[not(translate(.,$lowercase,$uppercase)=translate(following::state,$lowercase,$uppercase))]"


/>

     <xsl:for-each select="$unique-list">
     <xsl:value-of select="." /><BR/>
     </xsl:for-each>

</xsl:template>
********* end xsl file ***********

********* result file    ***********
xxxx<BR />yyyy<BR />xxXx<BR />
********* end result file  *******

I expected to get xxxx<BR />yyyy<BR /> as a result.

Thank you for your time and any help you provide.

Best,
Michal



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



Current Thread
Keywords