mmidy 01/10/09 09:43:30
Modified: java/src/org/apache/xml/dtm/ref DTMManagerDefault.java
Log:
If context node is a DOM attribute, we need to get to its parent using
getOwnerElement.
Revision Changes Path
1.23 +2 -1
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMManagerDefault.java
Index: DTMManagerDefault.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMManagerDefault.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- DTMManagerDefault.java 2001/10/09 14:53:01 1.22
+++ DTMManagerDefault.java 2001/10/09 16:43:30 1.23
@@ -434,7 +434,8 @@
// use getParent to find the root, instead of getOwnerDocument.
Otherwise
// DOM2DTM#getHandleOfNode will be very unhappy.
Node root = node;
- for (Node p = root.getParentNode(); p != null; p = p.getParentNode())
+ Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ?
((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode();
+ for (; p != null; p = p.getParentNode())
{
root = p;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]