You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/10/21 23:50:59 UTC

DO NOT REPLY [Bug 13830] New: - sort data-type="text" not sorting text with "-" correctly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13830>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13830

sort data-type="text" not sorting text with "-" correctly

           Summary: sort data-type="text" not sorting text with "-"
                    correctly
           Product: XalanJ2
           Version: CurrentCVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Xalan
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: tom.amiro@sun.com


When doing text sorts, both Xalan and XSLTC appear to be ignoring the 
"-" character. Textually, the - should come before 0.
Here's a simple test case modified from sort40.

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

<xsl:template match="/">
  <xsl:variable name="numnodes" select="doc/num" />
  <out>
    Descending order....
    <xsl:for-each select="$numnodes">
      <xsl:sort data-type="text" />
      <xsl:value-of select="."/><xsl:text> </xsl:text>
    </xsl:for-each>
  </out>
</xsl:template>

</xsl:stylesheet>


xml file
========
<?xml version="1.0"?>
<!-- Test for xsl:sort -->
<doc>
  <num>99</num>
  <num>3</num>
  <num>100</num>
  <num>40</num>
  <num>69</num>
  <num>82</num>
  <num>1</num>
  <num>0</num>
  <num>0008</num>
  <num>5</num>
  <num>04</num>
  <num>002</num>
  <num>666</num>
  <num>777</num>
  <num>Abc</num>
  <num>Hello</num>
  <num>-13</num>
  <num>-47</num>
</doc>

Obtained output  from Saxon, Xalan, and XSLTC
=============================================
Running saxon on sort
<?xml version="1.0" encoding="utf-8"?><out>
    Descending order....
    -13 -47 0 0008 002 04 1 100 3 40 5 666 69 777 82 99 Abc Hello </out>

Running xalan on sort
<?xml version="1.0" encoding="UTF-8"?>
<out>
    Descending order....
    0 0008 002 04 1 100 -13 3 40 -47 5 666 69 777 82 99 Abc Hello </out>


Running XSLTC with Xerces Parser on sort
<?xml version="1.0" encoding="UTF-8"?>
<out>
    Descending order....
    0 0008 002 04 1 100 -13 3 40 -47 5 666 69 777 82 99 Abc Hello </out>