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]
Other format: [Raw text]

Re: How to get a case insensetive grouping ??


Well, there is a general rule for using keys.

"The value used for looking up stuff via a key should be
fiddled with the same way as in the key definition"

Some examples:
Normalizing space:
 <xsl:key name="n-stuff" match="stuff"
   use="normalize-space(.)"/>
use
     select="key('n-stuff',normalize-space($val))"

Transforming characters:
 <xsl:key name="t-stuff" match="stuff"
   use="translate(.,$up,$lo)"/>
use
     select="key('t-stuff',translate($keyval,$up,$lo))"

A composite key value:
 <xsl:key name="l" match="locale"
   use="concat(country,'_',language)"/>
use
     select="key('l',concat($c,'_',$l))"

The rule is particularly important when using keys for Munchean
grouping, because the values for lookup come from the source
XML and cannot be supposed to be already in a proper form.

Unfortunately, this rule is not in any of the FAQs, and even
if it were, those in need to be reminded would hardly look for
it.

Regards
J.Pietschmann

 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]