Re: ACTION-2244: Remove the term deep copy

>
> Of course, insert says:
>
> "Each node in the origin-sequence is cloned in the order it appears in
> the
> sequence."
>
> which may just have moved the problem to there, since we don't strictly
> define what "clone" means.


Right, "clone" == "deep copy" ;)

I am now a little puzzled that there is no simple formal definition in any
of the XML specs, although to be fair, XSLT doesn't work via mutation but
by producing new trees, while here we have mutation.

The DOM has a `cloneNode(deep)` function. [1] However, reading it doesn't
exactly feels great, and I don't see a notion of in-scope namespaces, for
example.

The actual logic is simple: all node properties must be preserved in a deep
copy, except that all the nodes have new identities. [2]

-Erik

[1] https://www.w3.org/TR/domcore/#dom-node-clonenode
[2] https://www.w3.org/TR/xpath-datamodel/#node-identity

Received on Friday, 29 March 2019 17:28:59 UTC