neilg 2003/03/10 14:51:46
Modified: java/src/org/apache/xerces/impl/xs/identity Field.java
Log:
more complete fix for bug 16706; thanks to Navid Mehrigani for pointing out the
previous fix did not handle all cases.
Revision Changes Path
1.11 +4 -7
xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Field.java
Index: Field.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Field.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Field.java 10 Mar 2003 17:35:14 -0000 1.10
+++ Field.java 10 Mar 2003 22:51:46 -0000 1.11
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001, 2002 The Apache Software Foundation.
+ * Copyright (c) 2001-2003 The Apache Software Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -175,14 +175,11 @@
// verify that only one attribute is selected per branch
for (int i=0;i<fLocationPaths.length;i++) {
- int numAttrs = 0;
for(int j=0; j<fLocationPaths[i].steps.length; j++) {
org.apache.xerces.impl.xpath.XPath.Axis axis =
fLocationPaths[i].steps[j].axis;
- if (axis.type == axis.ATTRIBUTE) {
- numAttrs++;
- }
- if(numAttrs > 1) {
+ if (axis.type == axis.ATTRIBUTE &&
+ (j < fLocationPaths[i].steps.length-1)) {
throw new XPathException("c-fields-xpaths");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]