Subject: | keep_atts_order not working when using XML::Twig::Elt::copy |
XML::Twig-3.17 (and beyond)
perl v5.6.1, v5.8.4
Element attributes are not preserving their order when using elt->copy.
For me, this change mentioned below in XML::Twig::Elt::copy fixed the
problem:
sub copy {
.
.
.
# original code commented out
#
#{ my %atts= %{$atts}; # we want to do a real copy of the attributes
# $copy->set_atts( \%atts);
#}
{ my %atts;
tie %atts, 'Tie::IxHash' if (keep_atts_order());
%atts = %{$atts}; # we want to do a real copy of the attributes
$copy->set_atts( \%atts);
}
.
.
.
}