Skip Menu |
 

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

Report information
The Basics
Id: 23594
Status: resolved
Priority: 0/
Queue: XML-Generator

People
Owner: BHOLZMAN [...] cpan.org
Requestors: mzizka [...] hotmail.com
Cc:
AdminCc:

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



Subject: Embedded escaping does not work as expected
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1164386365-18455-15"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 341
Download (untitled) / with headers
text/plain 341b
Escaping values that are already escaped does not work as I would expect. For instance, if escaping HTML that already includes entites such as ">", I would expect the resulting escaped value to be ">", but it stays as is. (Hopefully the web site will not ruin my comment, but if that is the case, see comments in attached example.)
Subject: xml_generator_escaping.pl
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1164386364-18455-14"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: application/octet-stream; name="xml_generator_escaping.pl"
Content-Disposition: inline; filename="xml_generator_escaping.pl"
Content-Transfer-Encoding: base64
Content-Length: 590
use XML::Generator escape => 'always', conformance => 'strict', pretty => 2; my $html = '<a href="hxxp://potatoes.com">Potatoes & co &lt;here!&gt;</a>'; # Escaped my %attrs = (id => '19'); my $xml = tag(\%attrs, $html); print "$xml\n"; #==> <tag id="19">&lt;a href="hxxp://potatoes.com"&gt;Potatoes &amp; co &lt;here!&gt;&lt;/a&gt;</tag> ##### Warning: This result is wrong! ##### # CDATA my $xml_cdata = tag(\%attrs, xmlcdata($html)); print "$xml_cdata\n"; #==> <tag id="19"><![CDATA[<a href="hxxp://potatoes.com">Potatoes & co &lt;here!&gt;</a>]]></tag> ##### OK #####
MIME-Version: 1.0
X-Spam-Status: No, hits=-1.4 required=8.0 tests=BAYES_00,DK_POLICY_SIGNSOME,DK_POLICY_TESTING,DK_SIGNED,DK_VERIFIED,DNS_FROM_RFC_ABUSE,NO_REAL_NAME
X-Mailer: EarthLink Zoo Mail 1.0
Received-SPF: pass (x1.develooper.com: local policy)
Reply-To: bholzman [...] earthlink.net
Content-Type: text/plain; charset="UTF-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id B9EDD4D8005 for <bug-XML-Generator [...] rt.cpan.org>; Fri, 24 Nov 2006 16:47:10 -0500 (EST)
Received: (qmail 3517 invoked by alias); 24 Nov 2006 21:47:09 -0000
Received: from elasmtp-banded.atl.sa.earthlink.net (HELO elasmtp-banded.atl.sa.earthlink.net) (209.86.89.70) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 24 Nov 2006 13:47:04 -0800
Received: from [209.86.224.40] (helo=elwamui-milano.atl.sa.earthlink.net) by elasmtp-banded.atl.sa.earthlink.net with asmtp (Exim 4.34) id 1GnisY-0006Qo-El; Fri, 24 Nov 2006 16:46:38 -0500
Received: from 38.96.138.153 by webmail.pas.earthlink.net with HTTP; Fri, 24 Nov 2006 16:46:38 -0500
Delivered-To: cpan-bug+xml-generator [...] diesel.bestpractical.com
X-Elnk-Trace: e76c126de26d27561aa676d7e74259b7b3291a7d08dfec7970477caeb7d870f62dd5ee59a4bcd05a350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c
Subject: Re: [rt.cpan.org #23594] Embedded escaping does not work as expected
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=GKQtdVKGYMwnQFnaKxD9I7KRAadX25AdSuPNJFbz4+7hpEoUMUr7JYD8rvj677Fp; h=Message-ID:Date:From:Reply-To:To:Subject:Mime-Version:X-Mailer:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP;
Return-Path: <bholzman [...] earthlink.net>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-XML-Generator [...] rt.cpan.org
Date: Fri, 24 Nov 2006 16:46:38 -0500 (EST)
Message-Id: <17883710.1164404798420.JavaMail.root [...] elwamui-milano.atl.sa.earthlink.net>
X-Originating-Ip: 209.86.224.40
To: bug-XML-Generator [...] rt.cpan.org, undisclosed-recipients [...] null, null [...] null
Content-Transfer-Encoding: 7Bit
From: bholzman [...] earthlink.net
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-18472-1164404835-1985.23594-0-0 [...] rt.cpan.org>
Content-Length: 1285
Download (untitled) / with headers
text/plain 1.2k
How did you construct the XML::Generator object? To get escaping behavior, you have to ask for it: $ perl -MXML::Generator -le 'print XML::Generator->new( )->foo("&gt;")' <foo>&gt;</foo> $ perl -MXML::Generator -le 'print XML::Generator->new(escape => 1)->foo("&gt;")' <foo>&amp;gt;</foo> Benjamin Holzman Show quoted text
-----Original Message-----
>From: "M. Zizka via RT" <bug-XML-Generator@rt.cpan.org> >Sent: Nov 24, 2006 11:39 AM >To: undisclosed-recipients@null, null@null >Subject: [rt.cpan.org #23594] Embedded escaping does not work as expected > > >Fri Nov 24 11:39:27 2006: Request 23594 was acted upon. >Transaction: Ticket created by maz > Queue: XML-Generator > Subject: Embedded escaping does not work as expected > Broken in: 0.99 > Severity: (no value) > Owner: Nobody > Requestors: mzizka@hotmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23594 > > > >Escaping values that are already escaped does not work as I would >expect. For instance, if escaping HTML that already includes entites >such as ">", I would expect the resulting escaped value to be >"&gt;", but it stays as is. (Hopefully the web site will not ruin my >comment, but if that is the case, see comments in attached example.)
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-18428-1164411411-415.23594-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: BHOLZMAN [...] cpan.org
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 597
Download (untitled) / with headers
text/plain 597b
On Fri Nov 24 11:39:27 2006, maz wrote: Show quoted text
> Escaping values that are already escaped does not work as I would > expect. For instance, if escaping HTML that already includes entites > such as "&gt;", I would expect the resulting escaped value to be > "&amp;gt;", but it stays as is. (Hopefully the web site will not ruin my > comment, but if that is the case, see comments in attached example.)
Ah, ok, I hadn't seen the attachment. I agree that something is wrong. The difference between escape => 'always' and escape => 1 should not affect things, but it does seem to. Thanks, Benjamin Holzman


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.