On Sat, May 18, 2002 at 10:05:32AM -0400, Rob Richards wrote: > I have been going through the latest domxml extension and have a few > questions about it. Looking at the docs, it is indicated that > set_content and get_content are depreciated. > > set_content - Create a new node with e.g. DomDocument_create_text_node() und > add it with DomNode_append_child(). > get_content - Content is just a text node and can be accessed with > DomNode_child_nodes(). > > Would get_content really be replace with node_value? All the child_nodes > would give you is the child nodes.
the contents of an element-node are contained in a child-node of that element-node with the special node-name "#text". using child_nodes would give you these contents. but, without a get_content() (get_node_value()) function there is no way to get the nodeValue (content) of the "#text" node. hehe. i hope, that deprecating or even removing a get_content() function (or an equivalent) wont happen, because i definately dont want to replace entity-references in contents manually. the purpose of get_content() was and is to do that for me. > On that note, if you are trying to set the value of an existing node, using > the replacement (as indicated from the docs) you would should be creating a > new node and appending it, which means you then should remove the old node. > Shouldnt there be a set_node_value or similar function to just replace the > content of an existing node? A set_node_value function would be DOM > compliant as the nodeValue property is read/write according to the specs. heh, that is what set_content() is (was? i hope not) for. regards, -lukas -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php