lmartin 2003/11/18 14:23:00
Modified: java/src/org/apache/xerces/dom NodeImpl.java
Log:
Fix to compareDocumentPosition: when this is an attr and other is an ancestor node,
ensure CONTAINS bit is set in return value
Revision Changes Path
1.70 +5 -2 xml-xerces/java/src/org/apache/xerces/dom/NodeImpl.java
Index: NodeImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/NodeImpl.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- NodeImpl.java 17 Nov 2003 10:53:07 -0000 1.69
+++ NodeImpl.java 18 Nov 2003 22:23:00 -0000 1.70
@@ -1153,8 +1153,11 @@
for (node=thisNode; node != null; node=node.getParentNode()) {
thisDepth +=1;
if (node == otherNode)
+ {
// The other node is an ancestor of the owning element
- return DOCUMENT_POSITION_PRECEDING;
+ return (DOCUMENT_POSITION_CONTAINS |
+ DOCUMENT_POSITION_PRECEDING);
+ }
thisAncestor = node;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]