]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/common.xsl
A new wonderful page that shows the deadlines ordered by date.
[helm.git] / helm / mowgli / home / xsl / common.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
6 <xsl:template name="head">
7   <xsl:param name="path_to_top" select="'.'"/>
8   <br />
9   <table border="0" cellspacing="0" cellpadding="0" width="100%">
10     <tr>
11       <td align="left" valign="bottom">
12         <div class="small">
13           <a href="{$path_to_top}/home.html">MoWGLI: Mathematics on the Web: Get It by Logic and Interfaces</a>
14         </div>
15       </td>
16       <td align="right" valign="bottom">
17         <div class="small">
18           <a href="http://www.cordis.lu/ist"><img border="0" alt="IST Logo Small" src="{$path_to_top}/../images/istbutton_small.gif"/></a>
19         </div>
20       </td>
21     </tr>
22   </table>
23   <hr/>
24 </xsl:template>
25
26 <xsl:template name="foot">
27   <xsl:param name="path_to_top" select="'.'"/>
28   <hr/>
29   <table border="0" cellspacing="0" cellpadding="0" width="100%">
30     <tr>
31       <td align="left" valign="top">
32         <div class="small">
33           This pages are hosted by the
34           <a href="http:/www.cs.unibo.it">Department of Computer Science</a>,
35           <a href="http://www.unibo.it">University of Bologna</a>.
36         </div>
37       </td>
38       <td align="right" valign="top">
39         <div class="small">
40           <a href="http://www.cordis.lu/ist"><img border="0" alt="IST Logo Small" src="{$path_to_top}/../images/istbutton_small.gif"/></a>
41         </div>
42       </td>
43     </tr>
44   </table>
45   <br />
46 </xsl:template>
47
48 <xsl:template name="person-name">
49   <xsl:param name="file" select="''"/>
50   <xsl:variable name="person" select="document(concat('../xml/people/',$file,'.xml'))/person"/>
51   <xsl:if test="$person/qualification">
52    <xsl:value-of select="$person/qualification"/>
53    <xsl:value-of select="' '"/>
54   </xsl:if>
55   <xsl:value-of select="$person/name"/>
56   <xsl:value-of select="' '"/>
57   <xsl:value-of select="$person/surname"/>
58 </xsl:template>
59
60 <xsl:template name="print_date">
61  <xsl:param name="date"/>
62  <xsl:variable name="year" select="substring($date,1,4)"/>
63  <xsl:variable name="month" select="substring($date,5,2)"/>
64  <xsl:variable name="day" select="substring($date,7,2)"/>
65  <xsl:call-template name="print_month">
66   <xsl:with-param name="month" select="$month"/>
67  </xsl:call-template>
68  <xsl:text> </xsl:text>
69  <xsl:call-template name="print_day">
70   <xsl:with-param name="day" select="$day"/>
71  </xsl:call-template>
72  <xsl:text>, </xsl:text>
73  <xsl:value-of select="$year"/>
74 </xsl:template>
75
76 <xsl:template name="print_month">
77  <xsl:param name="month"/>
78  <xsl:choose>
79   <xsl:when test="$month = '01'">January</xsl:when>
80   <xsl:when test="$month = '02'">February</xsl:when>
81   <xsl:when test="$month = '03'">March</xsl:when>
82   <xsl:when test="$month = '04'">April</xsl:when>
83   <xsl:when test="$month = '05'">May</xsl:when>
84   <xsl:when test="$month = '06'">June</xsl:when>
85   <xsl:when test="$month = '07'">July</xsl:when>
86   <xsl:when test="$month = '08'">August</xsl:when>
87   <xsl:when test="$month = '09'">September</xsl:when>
88   <xsl:when test="$month = '10'">October</xsl:when>
89   <xsl:when test="$month = '11'">November</xsl:when>
90   <xsl:when test="$month = '12'">December</xsl:when>
91  </xsl:choose>
92 </xsl:template>
93
94 <xsl:template name="print_day">
95  <xsl:param name="day"/>
96  <xsl:choose>
97   <xsl:when test="$day = '01'">1st</xsl:when>
98   <xsl:when test="$day = '02'">2nd</xsl:when>
99   <xsl:when test="$day = '03'">3rd</xsl:when>
100   <xsl:when test="$day = '11'">11th</xsl:when>
101   <xsl:when test="$day = '11'">12th</xsl:when>
102   <xsl:when test="$day = '11'">13th</xsl:when>
103   <xsl:when test="substring($day,2,1) = '1'">
104    <xsl:value-of select="$day"/>
105    <xsl:text>st</xsl:text>
106   </xsl:when>
107   <xsl:when test="substring($day,2,1) = '2'">
108    <xsl:value-of select="$day"/>
109    <xsl:text>nd</xsl:text>
110   </xsl:when>
111   <xsl:when test="substring($day,2,1) = '3'">
112    <xsl:value-of select="$day"/>
113    <xsl:text>rd</xsl:text>
114   </xsl:when>
115   <xsl:otherwise>
116    <xsl:value-of select="$day"/>
117    <xsl:text>th</xsl:text>
118   </xsl:otherwise>
119  </xsl:choose>
120 </xsl:template>
121
122 </xsl:stylesheet>