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]

Re: Selecting case insensitively




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

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