[XML-SIG] Building a DOM tree
Thu, 25 Mar 1999 20:46:24 +0000 (/etc/localtime)
Andrew M. Kuchling writes:
> Jeff.Johnson@icn.siemens.com writes:
> > ....
> A good observation; the DOM Level 1 doesn't actually say
> whether the result of cloneNode() is associated with the same document
> or not. I'd suspect the answer is 'yes', but have written to the
> www-dom list asking about this.
Part 1.1.2 (Memory Management) of WD-DOM/level-one-core.html says:
In the DOM Level 1, objects implementing some interface "X" are
created by a "createX()" method on the Document interface; this is
because all DOM objects live in the context of a specific Document.
Thus, the cloned nodes must belong to *SOME* document.
Because, there is no explicite parameter for a second document,
they must belong to the document of the source nodes.
> >Not the most elegant solution. While I'm complaining, is there a good
> >reason that HtmlWriter closes the file passed to it? Because of that I
The most elegant way, probably, would be a visitor copying a
subtree of a source tree into a destination tree.