W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1999

RE: Cut/Paste from one document to another

From: Espen Frimann Koren <efk@objsys.no>
Date: Tue, 24 Aug 1999 11:12:19 +0200
Message-ID: <017C167A392ED211ACE900A0C906AB530AC111@zevs.objsys.no>
To: www-dom@w3.org
Yes, that is right. A document will only accept node that are created using
ist createX operations. This means that you have to clone the node you will
cut and paste, like this pseudo code:

newNode = newDocument.createNode(...);

As you can see this is conseptual code, but the point is that first you
create a new node similar to the old one, but connected to the new document
(although not part of the tree after the createNode statement). Then you
copy all attributes that are copyable, that is attributes that you can set
on the new node, and then you add the new node to your document (makes it
part of the tree)


PS! Does someone know whether this has changed in DOM 2.0? I think I have
seen something in the new interfaces in the spec that has this effect

-----Original Message-----
From: Daniel Glazman [mailto:Daniel.Glazman@der.edf.fr]
Sent: 24. august 1999 10:55
To: www-dom@w3.org
Subject: Cut/Paste from one document to another

Using DOM1, I can't find a way to "cut" a Node from one
document and "paste" it into another one. All methods are
supposed to raise an exception if I try to do that.

Can someone help me ? Thanks !!!

Received on Tuesday, 24 August 1999 05:13:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC