hi folks, while playing around with the schmematron validation used for xmlforms in cocoon 2.1 i had to face some strange misbehaviour with namespaced DOM attributes. downtracking led me to a bug in JXPath's DOMAttributeIterator: if you have an element with any qualified attributes and if you specify a non-existent namespaced attribute expression, JXPath will not return null() but one of the existing attributes.
i've attached both a simple example illustrating the bug and the patch. the misbehaviour occurs because the 'getAttribute' method will return the last negatively tested attribute instead of [null]. i don't know if the jdom-adapter is affected too. uli -- Ulrich Nicolas Liss�
Index:
E:/projects/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java,v
retrieving revision 1.6
diff -u -r1.6 DOMAttributeIterator.java
---
E:/projects/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java
10 Aug 2002 16:13:04 -0000 1.6
+++
+E:/projects/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java
+ 30 Nov 2002 16:57:09 -0000
@@ -175,6 +175,8 @@
return attr;
}
}
+ // nothing found !
+ attr = null;
}
return attr;
}
NamespacedDOMAttributesBug.java
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
