|
Hi,
I'm having trouble (in the form of DOM005 and
DOM006 errors) trying to pretty well clone most of a document. In
particular if I have a document like this (ignoring the processsing
instructions, DOCTYPE etc):
<root_element>
<header>
<action>ADD</action>
... (a defined hierarchy)
</header>
<body>
.. (a defined hierarchy)
</body>
</root_element>
and I want to duplicate all the elements within the
same document, changing the <action> value to say CHANGE for the second
set, as follows:
<root_element>
<header>
<action>ADD</action>
... (a defined hierarchy)
</header>
<body>
.. (a defined hierarchy)
</body>
<header>
<action>CHANGE</action>
... (a defined hierarchy)
</header>
<body>
.. (a defined hierarchy)
</body> How can I do this? I've tried various
combinations of cloneNode etc but always get either DOM005 Wrong document,
DOM006 Hierarchy request error or some other error.
By the way I'd like to know how to do this with DOM
1 and DOM 2.
Any help much appreciated.
--malcolm
|
- RE: How do I easily clone most of a document Malcolm Robbins
- RE: How do I easily clone most of a document Sridhar Raju Y
