OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: DOCBOOK-APPS: Sorting and non-en_US indexes


David Cramer wrote:

> Poking my head in autoidx.xsl (which, unsurpisingly, mystifies me), I
> notice the xsl:sorts don't have lang attributes. On the other hand, the
> DocBook community is pretty international, so I should think that if
> there were serious problems, there'd be more posts about it. Could
> somebody give me an indication of the status of generating indexes using
> the DocBook xsls and various languages?

At least, you must edit entities which defines grouping characters and
their lowercase/uppercase variants.
 
> A related question regards xsl processors and sorting. I checked Saxon's
> mailing list, but couldn't tell whether I could expect it to sort
> correctly out-of-the-box or if we'd have to do a little work:
> http://sourceforge.net/mailarchive/message.php?msg_id=77605
> http://sourceforge.net/mailarchive/message.php?msg_id=1048531
 
I use following code to left locale dependand comparsion to standard
Java class. If you put it on classpath, Saxon will use this class for
comparsion when lang is set to "cs". You can modify it to cope with
Japanese quite easily.

package com.icl.saxon.sort;

import java.text.Collator;
import java.util.Locale;

// Copyright Š International Computers Limited 1998
// See conditions of use

/**
 * A Comparer used with lang="cs".
 *
 * @author Jirka Kosek (jirka@kosek.cz)
 *
 */

public class Compare_cs extends TextComparer {

    int caseOrder = UPPERCASE_FIRST;

    /**
    * Compare two string objects, in three phases:
    * (a) ignoring accents and case
    * (b) if still equal, ignoring case
    * (c) if still equal, taking case into account
    * @return <0 if a<b, 0 if a=b, >0 if a>b
    */

    public int compare(Object a, Object b) {

        Collator csCollator = Collator.getInstance(new Locale("cs",
"cz"));

        return csCollator.compare(a, b);

    }

    public Comparer setCaseOrder(int caseOrder) {
        this.caseOrder = caseOrder;
        return this;
    }

}

-- 
-----------------------------------------------------------------
  Jirka Kosek  	                     
  e-mail: jirka@kosek.cz
  http://www.kosek.cz


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC