Hiya,
> Hi Anders,
>
> * Anders Karlsson <trudheim gmail.com> [2006-01-13
15:45]:
> >I have been looking through the perldoc for
XML::XPath to see
> >how toremove a node but there seems to be no method
te do this.
> >Does anyonehave a recipe for how to do this, or a
link to
> >somewhere thatdescribes how to?Google is not being
very helpful
> >on the matter... :-/ TIA,
>
> you cant do that with XPath. XPath is purely for
locating (sets
> of) nodes. You need a supporting API to *do* something
with the
> nodes. In general, using XPath implies using the DOM
(wretched as
> it is) to manipulate the tree.
I was looking for the same thing recently, and found some
undocumented
methods in the tests. I.e.
removeChild( $node )
removeAttribute( $attrName )
c.f. http://search.cpan.org/src/MSERGEANT/XML-XPath-1.1
3/t/remove.t
There is a lot of support in XML::XPath for creating and
appending nodes,
which is probably why I expected to find removal there too.
Next time
however, in light of these comments that seem in retrospect
correct, I
think I'll look elsewhere.
Regards,
David
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|