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=16399>.
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=16399

xsl:sort does not sort special characters properly (according to their ascii values)

           Summary: xsl:sort does not sort special characters properly
                    (according to their ascii values)
           Product: XalanJ2
           Version: 2.4
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Xalan
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


xsl:sort does not sort special characters properly (according to their ascii 
values)

Here is sample xml:

<?xml version="1.0" ?>
<sorting>
<test><char> </char></test>
<test><char>!</char></test>
<test><char>"</char></test>
<test><char>#</char></test>
<test><char>$</char></test>
<test><char>%</char></test>
<test><char>'</char></test>
<test><char>(</char></test>
<test><char>)</char></test>
<test><char>*</char></test>
<test><char>+</char></test>
<test><char>,</char></test>
<test><char>-</char></test>
<test><char>.</char></test>
<test><char>/</char></test>
<test><char>0</char></test>
</sorting>


Here is my stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text"/>
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
        <xsl:template match="/">
                <xsl:apply-templates select="sorting"/>
        </xsl:template>
        <xsl:template match="sorting">
                <xsl:for-each select="test">
                <xsl:sort select="char"/>
                        <xsl:value-of select="char"/>
                        <xsl:value-of select="$newline"/>
                </xsl:for-each>
        </xsl:template>
</xsl:stylesheet>


Here is output:

 <-- this is space
-
,
!
/
.
'
"
(
)
$
*
#
%
+
0

If you compare output to ascii table you will see several problems in output.

Reply via email to