]> rtime.felk.cvut.cz Git - edu/xsl.git/blob - course.xsl
Fixed when called from symlinked directory
[edu/xsl.git] / course.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 xmlns:date="http://exslt.org/dates-and-times"
4                 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
5                 exclude-result-prefixes="date"
6                 version="1.0">
7   
8   <!-- If you have /etc/xml/catalog setup properly, this won't fetch .xsl from internet. -->
9   <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
10   <xsl:param name="www.root" select="."/>
11   <xsl:param name="no.titlepage" select="0"/>
12   <xsl:param name="section.autolabel" select="1"></xsl:param>
13   <!-- <xsl:param name="img.src.path">resources/</xsl:param>-->
14
15   <xsl:param name="local.l10n.xml" select="document('')"/>
16   <l:i18n>
17     <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="cs" english-language-name="Czech">
18       <l:gentext key="LastChanged" text="Poslední změna"/>
19       <l:context name="datetime"><l:template name="format" text="A d. B Y"/></l:context>
20     </l:l10n>
21     <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en" english-language-name="English">
22       <l:gentext key="LastChanged" text="Last changed"/>
23       <l:context name="datetime"><l:template name="format" text="A, B d, Y"/></l:context>
24     </l:l10n>
25   </l:i18n>
26
27   <xsl:template name="user.head.content">  
28     <meta name="date">  
29       <xsl:attribute name="content">  
30         <xsl:call-template name="datetime.format">  
31           <xsl:with-param name="date" select="date:date-time()"/> 
32           <xsl:with-param name="format" select="'Y-m-d'"/>
33         </xsl:call-template>
34       </xsl:attribute>
35     </meta>
36     <xsl:call-template name="output.html.stylesheets">
37       <xsl:with-param name="stylesheets" select="concat($www.root, '/cv.css')"/>
38     </xsl:call-template>
39     <xsl:call-template name="output.html.stylesheets">
40       <xsl:with-param name="stylesheets" select="concat($www.root, '/styl.css')"/>
41     </xsl:call-template>
42   </xsl:template>
43
44   <xsl:template name="last.change">
45     <p><strong><xsl:call-template name="gentext">
46       <xsl:with-param name="key" select="'LastChanged'"/>
47       </xsl:call-template>: </strong>
48       <xsl:call-template name="datetime.format">  
49         <xsl:with-param name="date" select="date:date-time()"/> 
50         <xsl:with-param name="format">
51           <xsl:call-template name="gentext.template">
52             <xsl:with-param name="context" select="'datetime'"/>
53             <xsl:with-param name="name" select="'format'"/>
54           </xsl:call-template>
55         </xsl:with-param>
56       <xsl:with-param name="padding" select="0"/>
57     </xsl:call-template>
58     </p>
59   </xsl:template>
60
61   <xsl:template name="article.orig">
62     <div class="{name(.)}">
63       <xsl:call-template name="language.attribute"/>
64       <xsl:if test="$generate.id.attributes != 0">
65         <xsl:attribute name="id">
66           <xsl:call-template name="object.id"/>
67         </xsl:attribute>
68       </xsl:if>
69
70       <!-- We don't want titles etc. in the homepage -->
71       <xsl:if test="not($no.titlepage)">
72         <xsl:call-template name="article.titlepage"/>
73         
74         <xsl:variable name="toc.params">
75           <xsl:call-template name="find.path.params">
76             <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
77           </xsl:call-template>
78         </xsl:variable>
79         
80         <xsl:call-template name="make.lots">
81           <xsl:with-param name="toc.params" select="$toc.params"/>
82           <xsl:with-param name="toc">
83           <xsl:call-template name="component.toc">
84             <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
85           </xsl:call-template>
86         </xsl:with-param>
87         </xsl:call-template>
88         
89         <xsl:call-template name="last.change" />
90       </xsl:if>
91
92       <xsl:apply-templates/>
93       <xsl:call-template name="process.footnotes"/>
94     </div>
95   </xsl:template>
96
97   <!-- Include the template with website design -->
98   <xsl:include href="../design.xsl"/>
99
100   <xsl:output method="xml" encoding="UTF-8" />
101 </xsl:stylesheet>