From: Christophe de V. <cde...@al...> - 2002-11-21 13:46:40
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Jeudi 21 Novembre 2002 13:24, Paul Davis a =E9crit : > >Personally, I have tried to avoid using add_child(Node* node) for this > >reason. I think it would be best to say > >"All Nodes must be created by DomParser, not by yourself." > > i believe that this doesn't work when you are trying to build a tree > yourself before saving it back to disk. if you have a subtree built by > function B that is returned to function A for incorporation into the > nascent tree, its hard to see how you can get DomParser to handle > anything for you. i think. > =46or me it's more the owner of the Node (which could the DOMParser, but al= so=20 another node) which should handle creation and deletion of a node. On the other hand, let a method in Node to add a child without copying it=20 could be usefull if we, for example, merge a part of a tree in another : th= is=20 would avoid a copy of nodes that would be anyway deleted just after the=20 merge. But in this case the method should have an explicit name. =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAj3c444ACgkQB+sU3TyOQjD0KQCeNOzsoidQvHtV7ofnTQ5h+s41 6E8AmgJbgQaEFUIWVcPDyBLF+W08Oj4B =3Dbr8J =2D----END PGP SIGNATURE----- |