This has never been implemented, mostly because it's a pretty bogus notion,
and I never understood why the XSLT working group did this.  "case" is an
extremely complex notion in Unicode, and having upper-first/lower-first is
an extremely Euro-centric view of characters and collation.

You could certainly implement this yourself, by modifying the code in
NodeSorter::NodeSortKeyCompare::compare().  The Java processor has some
code that does this:

         //Process caseOrder parameter
         if (k.m_caseOrderUpper)
         {
           String tempN1 = n1String.getSourceString().toLowerCase();
           String tempN2 = n2String.getSourceString().toLowerCase();

           if (tempN1.equals(tempN2))
           {

             //java defaults to upper case is greater.
             result = result == 0 ? 0 : -result;
           }
         }

You can see it uses String.toLowerCase(), which is implemented in the ICU
using the class LowercaseTransliterator.  I'd like to integrate such a
function into Xalan at some point, but it's not really a high priority.

Dave



                                                                                       
                                                           
                      "Avula, Raj"                                                     
                                                           
                      <RAvula@firstam.         To:      "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>                                   
                      com>                     cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                                      
                                               Subject: XalanC Sort Case-Order.        
                                                           
                      03/19/2002 11:19                                                 
                                                           
                      AM                                                               
                                                           
                      Please respond                                                   
                                                           
                      to xalan-dev                                                     
                                                           
                                                                                       
                                                           
                                                                                       
                                                           




Hi,
             I am trying to use xsl:sort with xalanC1.3.
I had built ICU2.0 and re-built xalan with ICU.
I have started tying out some of the sorting functionality.
And  I found that case-order={upper-first|lower-first} attribute
is not working properly. Do I need to do anything to make this work
or is it a known problem?

If I try with xalan1.2 <xsl:sort order={ascending|descing} is also not
working properly.


Please let me know.

Here is sample xml:
<?xml version="1.0" encoding="UTF-8"?>
<AAA>
             <BBB>cc </BBB>
             <BBB>ff </BBB>
             <BBB>aa </BBB>
             <BBB>fff </BBB>
             <BBB>FFF </BBB>
             <BBB>Aa </BBB>
             <BBB>ccCCC </BBB>
</AAA>

Sample XSL:
     <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform";
version = "1.0" >
          <xsl:output method = "text" />


          <xsl:template match = "/AAA" >

               <xsl:text >Ascending: </xsl:text>
               <xsl:apply-templates select = "BBB" >

       <xsl:sort
case-order="upper-first" data-type="text" />
               </xsl:apply-templates>

          </xsl:template>

          <xsl:template match = "BBB" >
               <xsl:value-of select = "." />
               <xsl:text > </xsl:text>
          </xsl:template>


     </xsl:stylesheet>

And output I am getting is:
aa  Aa  cc  ccCCC  ff  fff  FFF







Thank you
Raj..

"MMS <firstam.com>" made the following
 annotations on 03/19/02 11:20:32
------------------------------------------------------------------------------

"THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED
SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN
CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION.  IF YOU ARE NOT THE
ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS
MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE
THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH.  IF YOU RECEIVE THIS
MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE THIS
MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."

==============================================================================







Reply via email to