xsl-list
[Top] [All Lists]

Re: Problem with case-sensitivity

2004-10-01 02:24:40
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey Luke,

you could translate both values to uppercase using the translate
function before comparing them:
<xsl:variable name='s1'
select='translate(@name,"abcdefghiklmnopqrstuvwxyz","ABCDEFGHIKLMNOPQRSTUVWXYZ")'/>
<xsl:variable name='s2'
select='translate($name,"abcdefghiklmnopqrstuvwxyz","ABCDEFGHIKLMNOPQRSTUVWXYZ")'/>

<xsl:if test='contains($s1,$s2)'>
...
</xsl:if>

hth,
Wolfgang


Luke Ambrogio wrote:
| Dear all,
|
| when i use the function:
|
| contains(@name,$name)
|
| it returns true only if even the case are the same, how do i go about
making
| it work even when the case is different i.e if @name = luke and $name
= Luke
| returns true?
|
| thanks in advance, regards
| Luke Ambrogio
|
|
| --+------------------------------------------------------------------
| XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
| To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
| or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
| --+--
|
|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBXSJYqjaicDyx8o8RAhayAJ9zM6AgT29o7jaiS3gXFFGRCa2cHQCfeVBR
8a9Ocg7m8HF8fa2vptAUy1w=
=rpl8
-----END PGP SIGNATURE-----


<Prev in Thread] Current Thread [Next in Thread>