I'm working with XML::LibXML in Perl.
Say I have two $element references gotten by different (opaque) XPath queries.
(How) can I determine, if the two $element (Node) refs are the same element in the document tree?
Comparing $el1 == $el2doesn't always work as far as I could tell.
It's in the XML::LibXML::Node documentation:
isSameNode
$bool = $node->isSameNode( $other_node );returns
TRUE (1)if the given nodes refer to the same node structure, otherwiseFALSE (0)is returned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With