Do XML::LibXML::Node::find
and related methods guarantee that the list of nodes will always be ordered as in the XML document?
This is important for me because my document corresponds to a big array in which I want to be able to delete series of items in certain circumstances, and I must make sure something like this works consistently:
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 this is not documented in XML::LibXML
, and I don't know whether this depends on libxml2
implementation, whose documentation I don't really understand, or on the DOM standard or some other W3C standard, which were clearly not written to be read my mere mortals.