Do XML::LibXML::Node::find and related methods ensure that the list of nodes is always ordered, as in an XML document?
This is important to me because my document corresponds to a large array in which I want to be able to delete a number of elements under certain circumstances, and I have to make sure that something like this works sequentially:
my @nodes = $dom->find('//MyElement[@attr=something]/descendant::Token/@id') ->get_nodelist; for my $token ( reverse map { $_->value } @nodes ) { splice @my_big_array, $token, 1; }
The difficulty is that it is not described in XML::LibXML , and I don’t know if it depends on the libxml2 implementation, the documentation I really don’t understand, or on the DOM standard or some other W3C standard that are clearly not were written to read my mere mortals.
scozy source share