in reply to •Re: Re: •Re: Re: Re: Re: HTML::Template - what's the rule of thumb?
in thread HTML::Template - what's the rule of thumb?

You are quite right Merlyn, I did not make myself entirely clear. (make note to /me : never start discussing with Merlyn in the morning unless you have at least had your second cup of strong tea)

The trouble I have with templates is indeed that you can (and many times have) to fall back to Perl (or whatever language is supported in the templating system), which defeats the purpose of making a clean split between logic and layout.

To get the data out the database, I rely on my good, old and trusted Perl-scripts. This is the "logic" part. Once the data is in XML-format, I hand it to the XSLT-script which does all the nice formatting (putting it in tables, adding headers and footers, coding the links, calculating sums and percentages, even providing the parameters to the GD-script for making the charts). Thanks to the filtering capacities of XSLT and XPath, the same XML-data can be used to present different views or extract different type of data.

I find that I rarely have to amend the basic Perl-scripts and that most of the work can be done in the XSLT-file.

DTD or Schema describes the XML-data, so (theoretically) anyone who knows DTD/Schema and XSLT can work with the data my scripts provide. Practically I'm the only one who does, so I could have put everything in one big Perl-script with tons of print statements and heredocs.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: •Re: Re: •Re: Re: Re: Re: HTML::Template - what's the rule of thumb?