Skip Menu |

This queue is for tickets about the XML-Twig CPAN distribution.

Report information
The Basics
Id: 39019
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: DOUGW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.32
Fixed in: (no value)



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
Subject: Re: [rt.cpan.org #39019] ISO-8859 encoding breaks empty_tags and keep_atts_order broken
Date: Sun, 7 Sep 2008 08:57:31 +0200
To: bug-XML-Twig [...] rt.cpan.org
From: "Michel Rodriguez" <xmltwig [...] gmail.com>
Hi, It looks like there are 2 bugs, one with the attribute order, and one with the expansion of the empty tag. I can reproduce your results, so I have all I need to investigate. Thanks -- mirod
Subject: Re: [rt.cpan.org #39019] ISO-8859 encoding breaks empty_tags and keep_atts_order broken
Date: Fri, 12 Sep 2008 11:07:36 +0200
To: bug-XML-Twig [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
Douglas Wilson via RT wrote: Show quoted text
> Fri Sep 05 13:51:44 2008: Request 39019 was acted upon. > Transaction: Ticket created by DOUGW > Queue: XML-Twig > Subject: ISO-8859 encoding breaks empty_tags and keep_atts_order broken > Broken in: (no value) > Severity: Normal > Owner: Nobody > Requestors: DOUGW@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39019 > > > > The following expands the B tag on output...without > the version/encoding line, it works fine (either way keep_atts_order > does not work):
OK, both bugs are fixed in the development version at http://xmltwig.com/xmltwig. The keep_atts_order option did not work because I did not tie the attribute hash when twig_roots was used. The bug with the expansion of the empty tag was due to XML::Parser's recognized_string (and original_string) methods only returning the string the first time it's called. Let me know if this version works for you. Thanks -- mirod
Fixed in 3.33 - thanks!