Subject: | ISO-8859 encoding breaks empty_tags and keep_atts_order broken |
The following expands the B tag on output...without
the version/encoding line, it works fine (either way keep_atts_order
does not work):
#!/users/sds/bin/perl
use strict;
use warnings;
use XML::Twig;
my $t = XML::Twig->new(
twig_roots => {
B => sub {
my ($t, $foo) = @_;
my $foo_value = $foo->{'att'}->{FOO};
if ( $foo_value and $foo_value eq 'BAR' ) {
$foo->set_att( FOO => "BAZ" );
}
$foo->print;
},
},
twig_print_outside_roots => 1,
keep_atts_order => 1,
empty_tags => 'normal',
);
$t->parsestring(<<EOT);
<?xml version="1.0" encoding="ISO-8859-1"?>
<A>
<B FOO="BAR" ABC="DEF"/>
</A>
EOT