You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2003/12/08 19:56:08 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/transformer NodeSorter.java

zongaro     2003/12/08 10:56:08

  Modified:    java/src/org/apache/xalan/transformer NodeSorter.java
  Log:
  Applying patch from Richard Cao (richcao@ca.ibm.com) for Bugzilla bug report
  5761.
  
  Removed code that caused keys to be ignored when they select an empty set of
  values.
  
  Revision  Changes    Path
  1.18      +9 -26     xml-xalan/java/src/org/apache/xalan/transformer/NodeSorter.java
  
  Index: NodeSorter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/NodeSorter.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- NodeSorter.java	17 Oct 2003 20:59:22 -0000	1.17
  +++ NodeSorter.java	8 Dec 2003 18:56:08 -0000	1.18
  @@ -526,9 +526,6 @@
        */
       NodeCompareElem(int node) throws javax.xml.transform.TransformerException
       {
  -
  -      boolean tryNextKey = true;
  -
         m_node = node;
   
         if (!m_keys.isEmpty())
  @@ -537,9 +534,6 @@
           XObject r = k1.m_selectPat.execute(m_execContext, node,
                                              k1.m_namespaceContext);
   
  -        if (r == null)
  -          tryNextKey = false;
  -
           double d;
   
           if (k1.m_treatAsNumbers)
  @@ -563,7 +557,7 @@
               current = ni.nextNode();
   
             // if (ni instanceof ContextNodeList) // %REVIEW%
  -          tryNextKey = (DTM.NULL != current);
  +          // tryNextKey = (DTM.NULL != current);
   
             // else abdicate... should never happen, but... -sb
           }
  @@ -572,25 +566,14 @@
           {
             NodeSortKey k2 = (NodeSortKey) m_keys.elementAt(1);
   
  -          if (!tryNextKey)
  -          {
  -            if (k2.m_treatAsNumbers)
  -              m_key2Value = new Double(0.0);
  -            else
  -              m_key2Value = k2.m_col.getCollationKey("");
  -          }
  -          else
  -          {
  -            XObject r2 = k2.m_selectPat.execute(m_execContext, node,
  -                                                k2.m_namespaceContext);
  -
  -            if (k2.m_treatAsNumbers)
  -            {
  -              d = r2.num();
  -              m_key2Value = new Double(d);
  -            }
  -            else
  -              m_key2Value = k2.m_col.getCollationKey(r2.str());
  +          XObject r2 = k2.m_selectPat.execute(m_execContext, node,
  +                                              k2.m_namespaceContext);
  +
  +          if (k2.m_treatAsNumbers) {
  +            d = r2.num();
  +            m_key2Value = new Double(d);
  +          } else {
  +            m_key2Value = k2.m_col.getCollationKey(r2.str());
             }
           }
   
  
  
  

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