This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
RE: Sorting and non-en_US indexes
- From: David Cramer <dcramer at broadjump dot com>
- To: Jirka Kosek <jirka at kosek dot cz>, Bob Stayton <bobs at caldera dot com>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Mon, 23 Sep 2002 12:11:36 -0500
- Subject: RE: DOCBOOK-APPS: Sorting and non-en_US indexes
Actually, I'm working on this right now. I noticed that limitation with
xsl:key. Even hiding the variable in a saxon:evaluate didn't work. Since
I'm ok with using Saxon extensions, I can do this tho. It appears to be
working:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:saxon="http://icl.com/saxon"
xmlns:f="http://www.broadjump.com/TechPubs/functions"
extension-element-prefixes="saxon"
exclude-result-prefixes="f"
version="1.1">
<!--
==================================================================== -->
<!-- Derived from Jeni Tennison's work in the HTML case -->
<saxon:function name="f:uppercase">
<xsl:variable name="uppercase">
'<xsl:call-template name="gentext.element.name">
<xsl:with-param
name="element.name">uppercase.alpha</xsl:with-param>
</xsl:call-template>'
</xsl:variable>
<saxon:return select="normalize-space($uppercase)"/>
</saxon:function>
<xsl:key name="letter"
match="indexterm"
use="translate(substring(&primary;, 1,
1),&lowercase;,f:uppercase())"/>
^^^^^^^^^^^^^^
Thanks,
David
> -----Original Message-----
> From: Jirka Kosek [mailto:jirka@kosek.cz]
> Sent: Monday, September 23, 2002 11:57 AM
> To: Bob Stayton
> Cc: David Cramer; docbook-apps@lists.oasis-open.org
> Subject: Re: DOCBOOK-APPS: Sorting and non-en_US indexes
>
>
> Bob Stayton wrote:
>
> > Have you looked at storing this information in
> > the XSL locale files in the 'common' directory?
> > There currently are uppercase.alpha and lowercase.alpha
> > gentext elements. They do store multiple alphabets now.
> > Those may not be in a form appropriate for
> > what you are doing, but they do provide a model
> > for storing language specific information.
>
> The problem is that you need this locale dependant information in
> xsl:key. Unfortunately expressions which can be used in xsl:key are
> quite limited -- they can't use variables so it's impossible to pull
> xsl:key with some data conditionally.
>
> This limitation will be probably eliminated in XSLT 2.0, but until 2.0
> will be widely adopted there probably won't be easy to use solution to
> this indexing problem. Editing autoidx.xsl or some entity fiddling is
> only solution which I can imagine for now.
>
> Jirka
>