The [dom::document createXXX $token ...] methods (where
createXXX is createElement, createTextNode, etc.) work
differently in the dom::tcl and dom::c TclDOM implementations.
In the Tcl implementation the new node is created as the
last child of $token, whereas in the C implementation it
is created as the child of an unattached documentFragment
(the $token argument is only used to determine what document
the new node should belong to).
The dom::tcl implementation is clearly much more useful --
with the C implementation it takes two steps to add a node
to the tree instead of just one -- but the dom::c implementation
more closely matches the W3C Recommendation.
When I brought this up earlier Steve indicated that the Tcl
version should be changed to bring it in line with the W3C Rec,
but I notice that the new 'xmlswitch' command relies on the
old behaviour :-)
So I'd like to raise this issue again. I'm still in favor
of keeping the dom::tcl interpretation. It disagrees with
the W3C DOM Rec, but it's also more sensible.
[Another discrepancy just noted: in the dom::tcl implementation,
it's possible for [dom::document createXXX $token] to create nodes
where they don't belong. For instance, if $token is a textNode,
[dom::document createElement $token FOO] doesn't complain
(but the node is inaccessible from the tree at that point and
if you try to reparent it there's an error.)]
--Joe English
jen...@fl...
|