Author: mrglavas
Date: Fri Jun 30 12:55:18 2006
New Revision: 418366

URL: http://svn.apache.org/viewvc?rev=418366&view=rev
Log:
Fixing JIRA Bug #1021:
http://issues.apache.org/jira/browse/XERCESJ-1021

DocumentType nodes cannot be imported. Instead of attempting to loop
over the children of the Document node we should delegate to the
cloneNode(CoreDocumentImpl,boolean) method on DocumentImpl which
knows how to do the right thing. This should also fix ID assignment
and possibly other things.

Modified:
    xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java

Modified: xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java?rev=418366&r1=418365&r2=418366&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java (original)
+++ xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java Fri Jun 30 
12:55:18 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999,2000,2004,2005 The Apache Software Foundation.
+ * Copyright 1999,2000,2004-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -627,16 +627,9 @@
     public Node cloneNode( boolean deep )
     {
         HTMLDocumentImpl    clone;
-        NodeImpl            node;
 
         clone = new HTMLDocumentImpl();
-        if ( deep ) {
-            node = (NodeImpl) getFirstChild();
-            while ( node != null ) {
-                clone.appendChild( clone.importNode( node, true ) );
-                node = (NodeImpl) node.getNextSibling();
-            }
-        }
+        cloneNode(clone, deep);
         return clone;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to