Skip Menu |
 

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

Report information
The Basics
Id: 79147
Status: rejected
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: jeffcc [...] suddenlink.net
Cc:
AdminCc:

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



Subject: expanded greater than symbol entity > not preserved in parse
Download (untitled) / with headers
text/plain 1.1k
XML file that contains &lt; and &gt; entities, only &lt; is preserved and &gt; converted to >. <code> use strict; use warnings; use XML::Twig; use Data::Dump qw' dd '; Main( @ARGV ); exit (0); sub Main { my %files; my $filename; my $subprint = sub { my( $twig, $_ ) = @_; push @{ $files{ $filename }}, $_->sprint; return; }; my $twig = XML::Twig->new( ignore_elts => { brief => 'discard', detailed => 'discard' }, pretty_print => 'indented', TwigHandlers => { 'myroot/classes' => $subprint, }, ); for my $file( @_ ) { $filename = $file; eval { $twig->safe_parsefile( $file ); 1; } or warn "ERROR parsefile($file): $@ "; $twig->purge; } dd \%files; } </code> XML file <code> <?xml version='1.0' standalone='yes'?> <myroot> <classes name="SomeClass::AccessLogic"> <public_typedefs> <members name="Ptr" kind="typedef" type="boost::shared_ptr&lt; BAR &gt;" virtualness="non_virtual"> <brief></brief> <detailed></detailed> </members> </public_typedefs> </classes> </myroot> </code>
Subject: Re: [rt.cpan.org #79147] expanded greater than symbol entity &gt; not preserved in parse
Date: Thu, 23 Aug 2012 07:07:23 -0400
To: bug-XML-Twig [...] rt.cpan.org
From: Michel Rodriguez <xmltwig [...] gmail.com>
Download (untitled) / with headers
text/plain 1.9k
Show quoted text
> doesn't need to be turned into an entity in XML, except when part of ']]>'.
You can use the escape_gt option when you create the twig to expand it anyway. -- mirod On Wed, Aug 22, 2012 at 4:58 PM, Jeff Cunningham via RT <bug-XML-Twig@rt.cpan.org> wrote: Show quoted text
> Wed Aug 22 16:58:10 2012: Request 79147 was acted upon. > Transaction: Ticket created by jeffcc > Queue: XML-Twig > Subject: expanded greater than symbol entity &gt; not preserved in parse > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: jeffcc@suddenlink.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=79147 > > > > XML file that contains &lt; and &gt; entities, only &lt; is preserved > and &gt; converted to >. > <code> > use strict; > use warnings; > use XML::Twig; > use Data::Dump qw' dd '; > > Main( @ARGV ); > exit (0); > > sub Main { > > my %files; > my $filename; > my $subprint = sub { > my( $twig, $_ ) = @_; > push @{ $files{ $filename }}, $_->sprint; > return; > }; > my $twig = XML::Twig->new( > ignore_elts => { brief => 'discard', detailed => 'discard' }, > pretty_print => 'indented', > TwigHandlers => { > 'myroot/classes' => $subprint, > }, > ); > for my $file( @_ ) { > $filename = $file; > eval { > $twig->safe_parsefile( $file ); > 1; > } or warn "ERROR parsefile($file): $@ "; > $twig->purge; > } > dd \%files; > } > </code> > > XML file > > <code> > <?xml version='1.0' standalone='yes'?> > <myroot> > <classes name="SomeClass::AccessLogic"> > <public_typedefs> > <members name="Ptr" kind="typedef" type="boost::shared_ptr&lt; BAR > &gt;" virtualness="non_virtual"> > <brief></brief> > <detailed></detailed> > </members> > </public_typedefs> > </classes> > </myroot> > </code>
-- mirod
From: jeffcc [...] suddenlink.net
Download (untitled) / with headers
text/plain 268b
On Thu Aug 23 07:07:32 2012, xmltwig@gmail.com wrote: Show quoted text
> > doesn't need to be turned into an entity in XML, except when part of
> ']]>'. > > You can use the escape_gt option when you create the twig to expand it > anyway. >
Not a bug - solved with escape_gt option.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.