You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Bill Blough (JIRA)" <ji...@apache.org> on 2013/10/14 11:29:41 UTC

[jira] [Created] (XALANC-753) sort with mixed case does not produce expected result

Bill Blough created XALANC-753:
----------------------------------

             Summary: sort with mixed case does not produce expected result
                 Key: XALANC-753
                 URL: https://issues.apache.org/jira/browse/XALANC-753
             Project: XalanC
          Issue Type: Bug
          Components: XalanC
    Affects Versions: 1.11, 1.10
         Environment: Debian GNU/Linux
            Reporter: Bill Blough
            Assignee: Steven J. Hathaway
            Priority: Minor


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>




--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org
For additional commands, e-mail: dev-help@xalan.apache.org