Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.10, 1.11
-
None
-
None
-
Debian GNU/Linux
Description
Forwarded from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=156428
Sorting does not work as expected, based on info at http://www.w3.org/TR/xslt#sorting
Input set: cABbaC
Expected output set: AaBbCc or aAbBcC (depending on case-order)
Actual output set: ABCabc
So it appears that sorts are partitioning results based on upper/lower case.
Steps to reproduce:
$ cat case-sort.xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<root>
<item>c</item>
<item>A</item>
<item>B</item>
<item>b</item>
<item>a</item>
<item>C</item>
<upper-first>
<xsl:for-each select="//item">
<xsl:sort select="."
lang="en"
case-order="upper-first"/>
<xsl:value-of select="."/>
</xsl:for-each>
</upper-first>
<lower-first>
<xsl:for-each select="//item">
<xsl:sort select="."
lang="en"
case-order="lower-first"/>
<xsl:value-of select="."/>
</xsl:for-each>
</lower-first>
</root>
</xsl:template>
</xsl:stylesheet>
$ testXSLT -xsl case-sort.xsl -in case-sort.xsl
<?xml version="1.0" encoding="UTF-8"?>
<root>
<item>c</item>
<item>A</item>
<item>B</item>
<item>b</item>
<item>a</item>
<item>C</item>
<upper-first>ABCabc</upper-first>
<lower-first>ABCabc</lower-first>
</root>