You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by er...@locus.apache.org on 2000/05/05 21:05:56 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/validators/common DFAContentModel.java
ericye 00/05/05 12:05:56
Modified: java/src/org/apache/xerces/validators/common Tag: schemawork
DFAContentModel.java
Log:
bug fix: comparison between 2 QName in this case should only involve localpart and uri. -- ericye
Revision Changes Path
No revision
No revision
1.1.2.3 +21 -3 xml-xerces/java/src/org/apache/xerces/validators/common/DFAContentModel.java
Index: DFAContentModel.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/common/DFAContentModel.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- DFAContentModel.java 2000/05/04 06:07:10 1.1.2.2
+++ DFAContentModel.java 2000/05/05 19:05:55 1.1.2.3
@@ -74,7 +74,7 @@
* are very constrained in form and easily handled via a special case.
* This also makes implementation of this class much easier.
*
- * @version $Id: DFAContentModel.java,v 1.1.2.2 2000/05/04 06:07:10 jeffreyr Exp $
+ * @version $Id: DFAContentModel.java,v 1.1.2.3 2000/05/05 19:05:55 ericye Exp $
*/
public class DFAContentModel
implements XMLContentModel {
@@ -345,14 +345,21 @@
int elemIndex = 0;
for (; elemIndex < fElemMapSize; elemIndex++)
{
- if (fElemMap[elemIndex] == curElem)
+ if (isEqual(fElemMap[elemIndex], curElem))
break;
}
// If we didn't find it, then obviously not valid
if (elemIndex == fElemMapSize) {
- if (DEBUG_VALIDATE_CONTENT)
+ if (DEBUG_VALIDATE_CONTENT) {
System.out.println("!!! didn't find it");
+
+ System.out.println("curElem : " +curElem );
+ for (int i=0; i<fElemMapSize; i++) {
+ System.out.println("fElemMap["+i+"] = " +fElemMap[i] );
+ }
+ }
+
return childIndex;
}
@@ -382,6 +389,17 @@
// success!
return -1;
+ }
+
+ private boolean isEqual(QName name1, QName name2) {
+ if (name1 != null && name2 != null) {
+
+ return name1.localpart == name2.localpart &&
+ name1.uri == name2.uri;
+
+ }
+ return false;
+
}
/**