zongaro     2002/12/21 02:24:44

  Modified:    java/src/org/apache/xalan/xsltc/runtime Tag: XSLTC_DTM
                        BasisLibrary.java
  Log:
  Changed compare operations for node against an axis iterator and for two axis
  iterators.  They now check whether the node handles are the same before 
getting
  the string value of the node, since the string values must be the same in that
  case.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.35.2.12 +30 -9     
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
  
  Index: BasisLibrary.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
  retrieving revision 1.35.2.11
  retrieving revision 1.35.2.12
  diff -u -r1.35.2.11 -r1.35.2.12
  --- BasisLibrary.java 13 Nov 2002 17:03:32 -0000      1.35.2.11
  +++ BasisLibrary.java 21 Dec 2002 10:24:44 -0000      1.35.2.12
  @@ -563,7 +563,16 @@
            int rnode;
            right.reset();
            while ((rnode = right.next()) != DTMAxisIterator.END) {
  -             if (compareStrings(lvalue, dom.getStringValueX(rnode), op, 
dom)) {
  +                // String value must be the same if both nodes are the same
  +                if (lnode == rnode) {
  +                    if (op == EQ) {
  +                        return true;
  +                    } else if (op == NE) {
  +                        continue;
  +                    }
  +                }
  +             if (compareStrings(lvalue, dom.getStringValueX(rnode), op,
  +                                   dom)) {
                    return true;
                }
            }
  @@ -580,16 +589,28 @@
   
        switch(op) {
        case EQ:
  -         value = dom.getStringValueX(node);
  -         while ((rnode = iterator.next()) != DTMAxisIterator.END) {
  -             if (value.equals(dom.getStringValueX(rnode))) return true;
  -         }
  +            rnode = iterator.next();
  +            if (rnode != DTMAxisIterator.END) {
  +             value = dom.getStringValueX(node);
  +                do {
  +                 if (node == rnode
  +                          || value.equals(dom.getStringValueX(rnode))) {
  +                       return true;
  +                    }
  +             } while ((rnode = iterator.next()) != DTMAxisIterator.END);
  +            }
            break;
        case NE:
  -         value = dom.getStringValueX(node);
  -         while ((rnode = iterator.next()) != DTMAxisIterator.END) {
  -             if (!value.equals(dom.getStringValueX(rnode))) return true;
  -         }
  +            rnode = iterator.next();
  +            if (rnode != DTMAxisIterator.END) {
  +             value = dom.getStringValueX(node);
  +                do {
  +                 if (node != rnode
  +                          && !value.equals(dom.getStringValueX(rnode))) {
  +                        return true;
  +                    }
  +             } while ((rnode = iterator.next()) != DTMAxisIterator.END);
  +            }
            break;
        case LT:
            // Assume we're comparing document order here
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to