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

But XSLT has a lot more possibilities than any templating system.
You had me up to here. Then I lost you, because you never justify it, and this is the point we differ on.

A "templating system" like Template Toolkit has all of Perl to escape to, without shifting gears. To extend XSLT, you have to code in some non-XSLT language. This implies the opposite of your statement.

What axis of interest are you looking at to say what you said?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

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

Replies are listed 'Best First'.
Re: •Re: Re: •Re: Re: Re: Re: HTML::Template - what's the rule of thumb?
by CountZero (Bishop) on Dec 21, 2003 at 13:54 UTC
    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