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


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.