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

Re: [xsl] Case conversion in XSL?


Subject: Re: [xsl] Case conversion in XSL?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 18 Oct 2001 11:02:57 +0100

Jim,

> whats the implication of adding an uppercase/lowercase function to
> XSLT ?

This is something that's covered in the F&O document with
xf:upper-case() and xf:lower-case() in Sections 3.5.15 and 3.5.16
(http://www.w3.org/TR/xquery-operators/#b2b7b4b6c14c50). I wrote the
following comments to the XQuery comments list about it:

  3.5.15 xf:upper-case and 3.5.16 xf:lower-case. These functions will
  be a real boon if defined and implemented properly (I also think
  that xf:title-case would be useful, though it might be harder to
  define because of the way different languages do capitalisation). It
  would be good to revise the wording so that it's clear that a single
  character might map to several characters when the case is
  converted. For example, the lower-case 'ß' should map to the two
  upper-case characters 'SS'. The length of the resulting string might
  be different from the length of the initial string.

  Talking about case - proper case-insensitive comparisons and
  case-insensitive functions could be really useful. In particular for
  xf:compare(), xf:contains(), xf:starts-with(), xf:ends-with(),
  xf:substring-before(), and xf:substring-after(). Perhaps the
  treatment of case is what you were aiming to gather from the
  collations in these cases?

Of course there are issues such as:

  xf:upper-case('heiße')  => 'HEISSE'
  xf:lower-case('HEISSE') => 'heisse'

but then case conversions are always a one-way process.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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



Current Thread
Keywords