thyme
about timian
summary & news
overview
some samples
license
mailing-lists
things to do
bugs!!
the author
get timian
supported platforms
download
building
binaries
documentation
manpage
change log
XSLT
report formats
report specs
Xalan extensions
DTDs
styles
overview
writing
gallery
analog
summary
XML explained
DTD analog-data
i18n
Overview
locale
languages
ISO639-2
ISO3166
UTF-8

feedback
tell me
© 2003 Per Jessen, per@computer.org.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

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>



        
<!-- <report>: add h2 for title, add gotos if requested, h3 for caption, then start table        -->
        
<xsl:template match="report">
                
<xsl:param name="repdef" />        <!-- the report-definitions <report> for which we're active -->
                
<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="" />

        
<!-- any number CSS stylesheets is allowed. They will be included in document order. -->
        
<style url="./timian.css" />
        
<style url="./local.css" />
        
<!-- <style url="gotos.css"/> -->

        
<!-- specifics for the HTML header - should be more or less self-explanatory -->
        
<shortcuticon url="/images/timian-3.ico" />
        
<baseurl url="" />

        
<!-- for the XHTML1.1 format, these are copied straight into the output -->
        
<meta name="robots" content="noindex,nofollow,noarchive" />

        
<!-- the goto setting is global and cannot be overridden by an individual report -->
        
<gotos show="yes" />

        
<!-- this establishes a default saying that headers will be shown -->
        
<header show="yes" />
        
<orderby col="" dir="descending" />
        
        
<locale language="en" territory="GB" />

        
<!-- overrides of locale specified -->
        
<format name="col_bytes" format="%.2f%d" />
        
<percent format="" />
        
<number format="" />

        
<!-- print a boilerplate and where -->
        
<boilerplate pos="top" />

        
<!-- where to find the lang-*.xml files for i18n -->
        
<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 XHTML 1.1 Conformant! CSS2 Conformant!