From: Joe E. <jen...@fl...> - 2001-05-08 22:03:41
|
> > You need to create a root element node before serializing the > > document; things should work properly then. > > So how do I create a "root element"? Ah, now I see the problem: one of the main differences between dom::tcl and dom::c is that, in dom::tcl, dom::document createXXX $parent ... adds the new node as a child of $parent, whereas dom::c creates it as an unattached, parentless node. You have to add the new node "by hand", e.g.,: dom::node appendChild $parent [dom::document createXXX $parent ...] The dom::tcl behaviour is more intuitive and useful, but the dom::c behaviour matches the W3C DOM specification more closely. When I last asked Steve about this he indicated that it would be best to follow the W3C spec. Steve - is this still your take on things, or would it be better to change dom::c to match the documentation and dom::tcl? --Joe English jen...@fl... |