neilg       2003/11/15 14:03:22

  Modified:    java/src/org/apache/xerces/impl/xs/identity
                        XPathMatcher.java Selector.java
  Log:
  fix for bug 24692
  
  Revision  Changes    Path
  1.20      +10 -7     
xml-xerces/java/src/org/apache/xerces/impl/xs/identity/XPathMatcher.java
  
  Index: XPathMatcher.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/identity/XPathMatcher.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XPathMatcher.java 12 Nov 2003 23:17:34 -0000      1.19
  +++ XPathMatcher.java 15 Nov 2003 22:03:22 -0000      1.20
  @@ -172,13 +172,16 @@
        * Returns value of first member of fMatched that
        * is nonzero.  
        */
  -    public int isMatched() {
  +    public boolean isMatched() {
           // xpath has been matched if any one of the members of the union have 
matched.
  -        for (int i=0; i < fLocationPaths.length; i++)
  -            if (((fMatched[i] & MATCHED) == MATCHED) && 
  -                    ((fMatched[i] & MATCHED_DESCENDANT_PREVIOUS) != 
MATCHED_DESCENDANT_PREVIOUS)) 
  -                return fMatched[i];
  -        return 0;
  +        for (int i=0; i < fLocationPaths.length; i++) 
  +            if (((fMatched[i] & MATCHED) == MATCHED) 
  +                    && ((fMatched[i] & MATCHED_DESCENDANT_PREVIOUS) != 
MATCHED_DESCENDANT_PREVIOUS) 
  +                    && ((fNoMatchDepth[i] == 0)
  +                    || ((fMatched[i] & MATCHED_DESCENDANT) == MATCHED_DESCENDANT))) 
  +                return true;
  +
  +        return false;
       } // isMatched():int
   
       //
  
  
  
  1.16      +6 -5      
xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Selector.java
  
  Index: Selector.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Selector.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Selector.java     11 Nov 2003 20:14:59 -0000      1.15
  +++ Selector.java     15 Nov 2003 22:03:22 -0000      1.16
  @@ -250,10 +250,11 @@
               super.startElement(element, attributes);
               fElementDepth++;
               // activate the fields, if selector is matched
  -            int matched = isMatched();
  +            //int matched = isMatched();
   
  -            if ((fMatchedDepth == -1 && ((matched & MATCHED) == MATCHED)) ||
  -                    ((matched & MATCHED_DESCENDANT) == MATCHED_DESCENDANT)) {
  +            if (isMatched()) {
  +/*            (fMatchedDepth == -1 && ((matched & MATCHED) == MATCHED)) ||
  +                    ((matched & MATCHED_DESCENDANT) == MATCHED_DESCENDANT)) { */
                   fMatchedDepth = fElementDepth;
                   fFieldActivator.startValueScopeFor(fIdentityConstraint, 
fInitialDepth);
                   int count = fIdentityConstraint.getFieldCount();
  
  
  

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

Reply via email to