[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Java DOM implementations and cloneNode

  • From: "Don Park" <donpark@q...>
  • To: <xml-dev@i...>
  • Date: Tue, 26 Jan 1999 00:02:39 -0800

java clonenode
>Am I expecting too much here? Shouldn't the classes that implement the
>DOM interfaces be able to copy via cloneNode, which is a DOM interface
>function? Is this a bug or expected behavior?


It is not a well known fact that DOM Level 1 does not dictate inter-document
operations or movement of nodes between documents.  You will find that
following is true:

Node node1 = doc1.createElement("boo");
Node node2 = node1.cloneNode(false);
if (node1.getOwnerDocument() == node2.getOwnerDocument())
    System.out.println("both the original and the clone belongs to same
document");

So when you tried to populate the second document with clones of the first
document, you were trying to move nodes from one document to another.

I am quite sure that some DOM implementations allow you do this although it
means your DOM code will no longer work with all DOM implementations.  If
you are willing to stretch your neck just so, you might give the currently
available version 1.0PR3 at www.docuverse.dom/domsdk/ a try.  I am fairly
certain I added code for this.  If not, Docuverse 1.0 Beta 1 definitely will
(soon, real soon now).

Best,

Don Park
Docuverse



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.