Re: [Q] Domxml: unlink() method?
| From: | Teodor Cimpoesu | Date: | Thu, 01 Feb 2001 19:13:34 +0000 |
| Subject: | Re: [Q] Domxml: unlink() method? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-37689@lists.php.net to get a copy of this message | ||
Peter Sabaini wrote:
>
> hello,
>
> i am rather desperately trying to figure out how to delete a node
> object from the DOM.
>
> say i have a node $node by manually traversing the DOM tree or by an
> xpath_eval() function call. i can access the children
> ($node->children()) or the parent ($node->parent()) or add a sub-node
> ($node->new_child()) but there seems to be no $node->unlink() or
> something like that to remove $node from my DOM tree.
>
> in libxml which the php domxml extension is built upon there's a
> function xmlUnlinkNode() which seems to do just that, but there is no
> binding for this function in php (or i didn't find it. i looked in
> ext/domxml/php_domxml.c).
>
> any solutions / workarounds / patches anyone? or am i being plain
> dumb -- i am pretty a php novice so chances are i overlooked the very
> very obvious.
>
I've been playing w/ DOM XML extension for my documentation catalog
(docs.digiro.net still work in progress ;), and my first shot would be
to unset the node from the children list of its parent. I also dig for
what
methods a DomNode, DomAttribute etc. have and figured out some. I would
like
to see them documented somewhere ...
-- teodor