Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

HTML::Seamstress - a push-style templating system

by metaperl (Curate)
on Feb 26, 2008 at 17:17 UTC ( [id://670329]=note: print w/replies, xml ) Need Help??


in reply to Re: HTML::Seamstress - the Outsider
in thread RFC - Template::Empty

Pipeline" in my essay means that the code is in charge of control flow rather than the template. In a callback style, decisions about what do next are in the template. Seamstress is pipeline.
Seamstress is push-style. Every other system on CPAN, whether callback or pipeline, is pull-style... oops! Template::Recall is push-style also. I have had little success in trying to email the author to chat
Petal embeds a programming language in XML files.
haha! told you fergal (grin).
HTML_Tree and Seamstress and XMLC all use ID and CLASS attributes to specify parts of an HTML file to replace or modify without embedding loops or conditionals in the template itself.
I see where you are coming from
  • they all only use Perl and HTML (no mini-language).
  • There is no embedding in the template.

I have some comments on your article, having read it closely:

HTML::Template is fairly rigid about insisting on a pipeline approach. It doesn't provide methods for calling back into Perl code during the HTML formatting stage; you have to do the work before running the template. The author of the module consider this a feature since it prevents developers from cheating on the separation of application code and presentation.
You might mention that HTML::Template::Expr adds callback support for HTML::Template.
There is a third approach, based on parsing an HTML document into a DOM tree and then manipulating the contents of the nodes. The only module using this approach is HTML_Tree.
That is not true. Seamstress does that. In fact Seamstress is on CPAN and maintained. HTML_Tree cant claim either of these things.
(said about HTML_Tree) This allows it to use genuine valid HTML documents as templates, something which none of these other modules can do.
You mention Petal in your survey. It (and Seamstress) certainly guarantees this. HTML::Template and tt have support for changing the template delimeter to an HTML comment, which might help.
I have beheld the tarball of 22.1 on ftp.gnu.org with my own eyes. How can you say that there is no God in the Church of Emacs? -- David Kastrup
[tag://push-style,html,templating]
Enforce strict model-view separation in template engines via HTML::Seamstress The car is in the cdr, not the cdr in the car

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://670329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-23 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found