[Petal] Observations

Jean-Michel Hiver jhiver@mkdoc.com
Thu, 12 Sep 2002 14:35:47 +0100


> > What exactly are you trying to do?
> 
> I'm trying to use Petal to parse an email template. Since the email will 
> be sent as plaintext, no parsing of the document will take place on the 
> client. I'm trying to create a link surrounded <> tags. I'm calling Petal 
> with HTML as the input parser and XHTML as the output.

Hi William,

Unfortunately XML::Parser cannot parse text because there is no top
element, and HTML::TreeBuilder is not very good at preserving
whitespaces.

I'm not sure that Petal is the right tool to send text emails. You could
try to write a Petal::Canonicalizer::Email I suppose. Or you could
output very basic HTML and run it through a HTML => Text converter. Or
you could use Text::Template :-)


For the ability to parse string templates rather than files, I have
looked into it and unfortunately using files is very structural. I don't
think I'll be able to implement this 'properly' with the current
architecture.

I could probably create a temp file and process from there... but it's
very bleurgh, thus I'm not sure that I want to do this. It's a shame
that I didn't foresee that... sorry :-(


For the 'list of hashref' bug, I have made a test and it works fine.  I
added it to the test suite, you can amend it / run it as follow:

[jhiver@frogette Petal]$ perl t/022_Hashref_List.t 
1..3
ok 1
ok 2
ok 3
[jhiver@frogette Petal]$ 

I'm going to do a minor Petal release now (0.71), with the added list of
hashrefs test and the updated docs.


Cheers,
-- 
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
  Jean-Michel Hiver - Software Director
  jhiver@mkdoc.com
  +44 (0)114 255 8097
================================================================
                                      VISIT HTTP://WWW.MKDOC.COM