Problems with mirrors.xml and advisories.xml

Martin Heinen martin at sumuk.de
Thu Dec 18 00:09:02 UTC 2003


On Mon, Dec 15, 2003 at 06:11:10PM +0100, Martin Horcicka wrote:
> Hiroki Sato (2003-12-16 01:15 +0900):

> >  The menu entries will be sorted in alphabetical order of *translated*
> >  country name.  Didn't it work properly?  If you use transtable but
> >  the sort order is wrong, please show me the results (and the changes
> >  you added).  At least I know it works fine for www/ja.
> >
> >  Or, is non-alphabetical order needed?
> 
> Yes, the menu entries are sorted in alphabetical order of translated country
> names but the sort ordering seems to be English - e.g. all non-English
> characters are sorted after the English ones. What I want is Czech sort
> ordering. I've exported the doc and www trees and added doc/cs_CZ.ISO8859-2
> and www/cs (which are not in the official cvs repository yet) to:

I encountered the same problem when sorting by
translated country names.  Attached is a simple
test case:  Running »xsltproc sort.xsl names.xml«
will produce the following list:

| <word>Deutschland</word>
| <word>Dänemark</word>
| <word>a</word>
| <word>b</word>
| <word>c</word>
| <word>Ä</word>
| <word>ä</word>

This is wrong, »names.xml« is already sorted
so the order should not change.

It seems that language dependent sorting is
not supported in textproc/libxslt.  The file
»FEATURES« of libxslt-1.1.0 contains the following:

| YES			      xsl:sort
| YES				select = string-expression
| NO				lang = { nmtoken }

Hiroki's work is such a big time saver that
I consider to commit the German version with the
slightly displaced ordering.  This might give
me the time to think about a solution for the
problem instead of sorting manually :-)

-- 
Marxpitn
-------------- next part --------------
<?xml version="1.0" encoding="iso-8859-1"?>

<list>
  <word>a</word>
  <word>ä</word>
  <word>b</word>
  <word>c</word>
  <word>Ä</word>
  <word>Dänemark</word>
  <word>Deutschland</word>
</list>
-------------- next part --------------
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output type="xml" encoding="iso-8859-1"
	      omit-xml-declaration="yes"
	      indent="yes"/>

  <xsl:template match="/list">
    <list>
    <xsl:for-each select="word">
      <xsl:sort lang="de-DE" data-type="text" select="." />
      <word>
      <xsl:value-of select="." />
      </word>
    </xsl:for-each>
    </list>
  </xsl:template>
</xsl:stylesheet>


More information about the freebsd-doc mailing list