You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2002/09/03 19:55:32 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/identity XPathMatcher.java
neilg 2002/09/03 10:55:32
Modified: java/src/org/apache/xerces/impl/xs/identity
XPathMatcher.java
Log:
fix for bug #12234
Revision Changes Path
1.12 +12 -2 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.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XPathMatcher.java 23 Aug 2002 22:52:07 -0000 1.11
+++ XPathMatcher.java 3 Sep 2002 17:55:32 -0000 1.12
@@ -118,9 +118,14 @@
// constants describing whether a match was made,
// and if so how.
+ // matched any way
protected static final int MATCHED = 1;
+ // matched on the attribute axis
protected static final int MATCHED_ATTRIBUTE = 3;
+ // matched on the descendant-or-self axixs
protected static final int MATCHED_DESCENDANT = 5;
+ // matched some previous (ancestor) node on the descendant-or-self-axis, but not this node
+ protected static final int MATCHED_DESCENDANT_PREVIOUS = 13;
//
// Data
@@ -183,7 +188,9 @@
public int 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) return fMatched[i];
+ if (((fMatched[i] & MATCHED) == MATCHED) &&
+ ((fMatched[i] & MATCHED_DESCENDANT_PREVIOUS) != MATCHED_DESCENDANT_PREVIOUS))
+ return fMatched[i];
return 0;
} // isMatched():int
@@ -275,6 +282,9 @@
if ((fMatched[i] & MATCHED_DESCENDANT) == MATCHED || fNoMatchDepth[i] > 0) {
fNoMatchDepth[i]++;
continue;
+ }
+ if((fMatched[i] & MATCHED_DESCENDANT) == MATCHED_DESCENDANT) {
+ fMatched[i] = MATCHED_DESCENDANT_PREVIOUS;
}
if (DEBUG_STACK) {
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org