[Petal] Petal and
Bruno Postle
bruno at mkdoc.com
Tue Mar 15 20:48:36 GMT 2005
On Tue 15-Mar-2005 at 12:58 -0600, wsmith wrote:
> I was just wondering if anyone has any input in the fact that
> petal changes to  , but does *not* modify  
> (the unicode equivilant). Is this a bug or how petal is supposed
> to work?
Yes, this is because Petal is treating your template as XML. If you
create a template like this:
<a>  </a>
..and process it like this:
$Petal::INPUT = 'XHTML';
my $a = new Petal ('nbsp.xml');
print $a->process;
As expected, you get two identical non-breaking-space characters:
<p> </p>
If you process it like this (XML is the Petal default):
$Petal::INPUT = 'XML';
my $a = new Petal ('nbsp.xml');
print $a->process;
..suprisingly, you see this output:
<p>&nbsp; </p>
This is because " " isn't a XML entity. You can check with
xmllint:
$ xmllint nbsp.xml
nbsp.xml:1: parser error : Entity 'nbsp' not defined
So, use " " instead of " ", or tell Petal the template is
XHTML rather than XML.
--
Bruno
More information about the Petal
mailing list