An approach you might look into is using generating the page content as XML and then transforming that XML using some kind of stylesheeting system; AxKit is an XML publishing application that runs under mod_perl; it can use different kinds of XML stylesheets, including the most popular, XSLT. The basic idea is that the XSLT instructions take XML content and transform it into HTML (or XML, or plain text, or PDF, or ...)

The beauty of XML stylesheets is that you have complete control over the resulting HTML; not only can you control colors, background images, etc. as you can with CSS, but you can control the order of appearance of elements (or even whether a given element will appear at all). You can customize the HTML you produce for different browsers (i.e. you don't have to write HTML that degrades gracefully; you can use all the bells and whistles supported by IE 5.5 for users with IE 5.5, and you can output straightforward HTML 3.2 for users with Netscape 3.0). And of course you can define different stylesheets for different themes.

It's a really flexible system. The drawback is that it's pretty complex. The big plus, other than the flexibility, is that you can achieve a *very high* degree of separation between content and presentation.

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'

In reply to Re: Laying out a web page by arturo
in thread Laying out a web page by prarie dawn

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.