[Petal] [REQ] Escape HTML entities

Paul Arzul patricka at mkdoc.com
Wed Oct 8 14:14:04 BST 2003


On Wed 08-Oct-2003 at 12:05:24PM +0100, Jean-Michel Hiver wrote:
> OK more on this...
> 
> I have upgraded my XML::Parser, added the extra suggested line in
> Petal::Canonicalizer::XML, and changed the following file in the test
> suite:
> 
>   [jhiver at frogette Petal-1.06]$ more t/data/entities.xml 
>   <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
>   <html>
>     <body>&lt; &copy;</body>
>   </html>
> 
> Now, running perl t/017_Entities.t I get:
> 
>   <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
>   <html>
>     <body>&lt; </body>
>   </html>
> 
> As you can see the copyright symbol gets stripped... Which means it
> still doesn't work on my machine. I also tried &eacute; to no effect.
> 
> Any ideas?

i don't know but i get the following (after applying the patch):

$ perl t/017_Entities.t
ok 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< text="DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;"></>
<html>
<body>&lt; &amp;copy;</body>
</html>1..1

- p



More information about the Petal mailing list