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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to