You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by le...@locus.apache.org on 2000/12/12 22:46:59 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/dom AttributeMap.java

lehors      00/12/12 13:46:58

  Modified:    java/src/org/apache/xerces/dom AttributeMap.java
  Log:
  cloneContent failed to set the ownerNode
  
  Revision  Changes    Path
  1.9       +16 -0     xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java
  
  Index: AttributeMap.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AttributeMap.java	2000/11/13 18:15:05	1.8
  +++ AttributeMap.java	2000/12/12 21:46:56	1.9
  @@ -492,6 +492,22 @@
       	return newmap;
       } // cloneMap():AttributeMap
   
  +    /**
  +     * Override parent's method to set the ownerNode correctly
  +     */
  +    protected void cloneContent(NamedNodeMapImpl srcmap) {
  +    	if (srcmap.nodes != null) {
  +            nodes = new Vector(srcmap.nodes.size());
  +            for (int i = 0; i < srcmap.nodes.size(); ++i) {
  +                NodeImpl n = (NodeImpl) srcmap.nodes.elementAt(i);
  +                NodeImpl clone = (NodeImpl) n.cloneNode(true);
  +                clone.isSpecified(n.isSpecified());
  +                nodes.insertElementAt(clone, i);
  +                clone.ownerNode = ownerNode;
  +                clone.isOwned(true);
  +            }
  +        }
  +    } // cloneContent():AttributeMap
   
       //
       // Protected methods