Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Even without some of the additional test cases that I think I'll add tonight as suggested by Matts and gellyfish, I think my example demonstrates the apprear of code that tries to separate presentation and content. The DBI/print and DBI/CGI solutions are fast, but ugly, IMO (even slicking up the CGI with a map, it's still ugly). All the template and XSLT solutions, on the other hand, have no hint of presentation in the code, and that is all delegated to separate files. Mind you, since TT2 appears to be limited in handling of pure XML data (given the poor speed), you may have to do some massaging of data to get it ready for passing to TT2 as I had to do (the join oneliner).

Of course, when you then turn to the template files or stylesheets, you may be scared by either one. One thing, though I want to use XSTL, is that unless you are using a editor that can make it easy to distinquish between the XSL directives and the XHTML markup, it might be hard to determine the difference between what's what in the stylesheet; on the other hand, the template specific code is easy to pick out from the [% %] blocks. But these differences may be simply personal opinion; some might find anything XML-based easy to read, and find the template solution to be tag-soup ( As an aside, I see that in TT2 2.06, if not earlier, you can specify which tags TT2 will look for, including using SGML comments <!-- --> as delimiters.)

However, I suspect the real test will come when I start putting together other parts of a CGI system I'm working on, such that I run through multiple XSLT transformations. This *should* be as easy as chaining the results one after another, but....

Dr. Michael K. Neylon - || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

In reply to Template coding effiencies (Re x4: XSLT vs Templating, Part 2) by Masem
in thread XSLT vs Templating, Part 2 by Masem

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the voices are still...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (3)
    As of 2018-05-21 23:06 GMT
    Find Nodes?
      Voting Booth?