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

Report information
The Basics
Id:
125304
Status:
rejected
Priority:
Low/Low
Queue:

People
Owner:
MIROD [...] cpan.org
Requestors:
chrispitude [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
3.52
Fixed in:
(no value)



Subject: > HTML metacharacters in text are not preserved
We use HTML metacharacters in our text content. The &lt; (<) metacharacter is preserved, but the &gt; (>) metacharacter is not. You can reproduce this with the following short perl script: ==== #!/usr/bin/perl use strict; use warnings; use XML::Twig; my $t=XML::Twig->new(); $t->parse('<pre>&lt;hello&gt;</pre>'); $t->print(pretty_print => 'indented'); ==== The output is: <pre>&lt;hello></pre> ^ not escaped
Although - is this still valid/equivalent XML syntax, because the leading bracket is escaped and thus the trailing one does not have to be?
On Sat May 12 11:08:15 2018, chrispitude@gmail.com wrote:
Show quoted text
> Although - is this still valid/equivalent XML syntax, because the > leading bracket is escaped and thus the trailing one does not have to > be?
Yes, escaping '>' is not needed, it is always valid (except in one edge case with CDATA sections). You can use the escape_gt option when you create the XML::Twig object to change the default behavior though. __ mirod
Thanks! Then this is user error, as the behavior is valid *and* it is controllable. I have changed the status to 'rejected' (I hope this is correct!).


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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