On 07/02/2013 06:58 PM, H.Merijn Brand via RT wrote:
Show quoted text> Tue Jul 02 14:58:25 2013: Request 86651 was acted upon.
> Transaction: Ticket created by HMBRAND
> Queue: XML-Twig
> Subject: formatting creates invalid XML due to quotes
> Broken in: 3.44
> Severity: Critical
> Owner: Nobody
> Requestors: HMBRAND@cpan.org
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=86651 >
>
>
> $ cat test.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <things>
> <thing name='"foo' size="3" />
> </things>
> $ xml_pp < test.xml >z.xml
> $ cat z.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <things>
> <thing name=""foo" size="3"/>
> </things>
> $ xml_pp < z.xml
>
> not well-formed (invalid token) at line 3, column 16, byte 64:
> <things>
> <thing name=""foo" size="3"/>
> ===============^
> </things>
> at /pro/lib/perl5/site_perl/5.18.0/i686-linux-64int-ld/XML/Parser.pm line 187.
> at /pro/bin/xml_pp line 82.
> Exit 255
> $
>
Indeed that's a critical one.
It's weird, since
perl -MXML::Twig -e'XML::Twig->parse( "test.xml")->print'
or
perl -MXML::Twig -e'XML::Twig->parse( pretty_print => "indented",
"tquote.xml")->print'
both do the right thing and output <thing name=""foo" size="3"/>
I'll look at this tomorrow.
Tnaks for the report.
--
mirod