You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2001/09/20 17:09:58 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref DTMNodeProxy.java
jkesselm 01/09/20 08:09:58
Modified: java/src/org/apache/xml/dtm/ref DTMNodeProxy.java
Log:
Enable Attr.getOwnerElement()
Revision Changes Path
1.7 +6 -1 xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeProxy.java
Index: DTMNodeProxy.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeProxy.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DTMNodeProxy.java 2001/07/12 02:21:00 1.6
+++ DTMNodeProxy.java 2001/09/20 15:09:58 1.7
@@ -1122,7 +1122,12 @@
*/
public final Element getOwnerElement()
{
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
+ if (getNodeType() != Node.ATTRIBUTE_NODE)
+ return null;
+ // In XPath and DTM data models, unlike DOM, an Attr's parent is its
+ // owner element.
+ int newnode = dtm.getParent(node);
+ return (newnode == -1) ? null : (Element)(dtm.getNode(newnode));
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org