Timian styles
The visual presentation of a Timian formatted report is determined by 3 elements:
• the Timian stylesheet (XSLT)
<xsl:template match="timespan">
<xsl:value-of select="tx:strftime('%Y-%m-%d %H:%M',@from)" />
</xsl:template>
<!---->
<xsl:template match="report">
<xsl:param name="repdef" /> <!---->
<xsl:param name="rindex" />
<xsl:message>processing "<xsl:value-of select="@name" />"</xsl:message>
<xsl:variable name="rep" select="@name" />
<xsl:variable name="x1" select="concat('title-',@name)" />
<h2 id="section{$rindex}">
<xsl:call-template name="find_string"><xsl:with-param name="key" select="$x1" /></xsl:call-template>
<xsl:text> </xsl:text><xsl:value-of select="$repdef/@tag" />
</h2>
<xsl:apply-templates select="reportspan" />
<xsl:variable name="x3" select="concat('caption-',@name)" />
<h3><xsl:value-of select="$catalogue/phrase[@key=$x3]" /></h3>
<xsl:if test="$repdef/piechart/@show='yes'">
<xsl:variable name="colset" select="$repdef/piechart/@scheme" />
The above is an example of what XSLT-code looks like (an excerpt from a Timian stylesheet). A Timian stylesheet
is just another XML-document.
• the Timian specification (XML)
<settings>
<report logo="timian.jpeg" href="http://timian.jessen.ch/" />
<site name="the Timian webserver" url="http://timian.jessen.ch/" />
<imagelocation url="/images/" local="" />
<chartlocation url="charts/" local="" />
<!---->
<style url="./timian.css" />
<style url="./local.css" />
<!---->
<!---->
<shortcuticon url="/images/timian-3.ico" />
<baseurl url="" />
<!---->
<meta name="robots" content="noindex,nofollow,noarchive" />
<!---->
<gotos show="yes" />
<!---->
<header show="yes" />
<orderby col="" dir="descending" />
<locale language="en" territory="GB" />
<!---->
<format name="col_bytes" format="%.2f%d" />
<percent format="" />
<number format="" />
<!---->
<boilerplate pos="top" />
<!---->
<i18n url="/usr/local/share/timian" />
</settings>
The above is an example of what the <settings> part of a Timian specification might look like.
• one or more CSS stylesheets
If you're reading this, chances are you have a pretty good understanding of what CSS stylesheets
look like and can and cannot do.
the Timian stylesheet
The Timian stylesheet written in XSLT is where the bulk of the effort goes. The stylesheet specifies what to do
with the XML data read, and what and how to produce output.
the Timian specification
Although the stylesheet could quite comfortably hold all the information necessary to produce the desired output,
this would be very inflexible (otherwise known as "hard-coding" or "hard-wired"). Instead, certain parts are made
optional/parameterisable such that the behaviour of the stylesheet can be easily controlled from an external document -
the Timian specification document. It is worth noting that the Timian specification is nothing but an XML document whose
structure and information is defined by the Timian stylesheet; i.e. the Timian specification is unique to the stylesheet.
CSS Stylesheets
CSS stylesheets primarily affect the appearance of the produced output; CSS affects colours, fonts, margins etc.
A Timian formatted report relies almost entirely on stylesheets to supply formatting information.
styles
The Timian style gallery
|
Last time this page was updated:
Friday 9 May 2003 10:48
|
|
|