]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/person.xsl
Several bug-fixes:
[helm.git] / helm / mowgli / home / xsl / person.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:import href="common.xsl"/>
7
8 <xsl:output method="xml"/>
9
10 <xsl:template match="/">
11  <html>
12   <head>
13    <title>
14     <xsl:call-template name="qualified-name">
15      <xsl:with-param name="qualification"
16                      select="person/qualification"/>
17      <xsl:with-param name="name"
18                      select="person/name"/>
19      <xsl:with-param name="surname"
20                      select="person/surname"/>
21     </xsl:call-template>
22    </title>
23   </head>
24   <body>
25     <xsl:apply-templates/>
26   </body>
27  </html>
28 </xsl:template>
29
30 <xsl:template name="qualified-name">
31  <xsl:param name="qualification" select="/.."/>
32  <xsl:param name="name"/>
33  <xsl:param name="surname"/>
34  <xsl:if test="qualification">
35   <xsl:value-of select="$qualification"/>
36   <xsl:text> </xsl:text>
37  </xsl:if>
38  <xsl:value-of select="$name"/>
39  <xsl:text> </xsl:text>
40  <xsl:value-of select="$surname"/>
41 </xsl:template>
42
43 <xsl:template match="person">
44  <h1>
45   <xsl:call-template name="qualified-name">
46    <xsl:with-param name="qualification"
47                    select="qualification"/>
48    <xsl:with-param name="name"
49                    select="name"/>
50    <xsl:with-param name="surname"
51                    select="surname"/>
52   </xsl:call-template>
53  </h1>
54  <xsl:choose>
55   <xsl:when test="count(position) &gt; 1">
56    <ul>
57     <xsl:for-each select="position">
58      <li><xsl:value-of select="."/></li>
59     </xsl:for-each>
60    </ul>
61   </xsl:when>
62   <xsl:when test="count(position) = 1">
63    <p><xsl:value-of select="position"/></p>
64   </xsl:when>
65  </xsl:choose>
66  <p>
67   <xsl:text>e-mail: </xsl:text>
68   <a href="mailto:{e-mail}">
69    <xsl:value-of select="e-mail"/>
70   </a>
71  </p>
72  <xsl:if test="url">
73   <p>
74    <xsl:text>Home Page: </xsl:text>
75    <a target="_top" href="{url}">
76     <xsl:value-of select="url"/>
77    </a>
78   </p>
79  </xsl:if>
80  <xsl:if test="address">
81   <p>
82    <xsl:text>Address: </xsl:text>
83    <xsl:value-of select="address"/>
84   </p>
85  </xsl:if>
86  <xsl:if test="telephone">
87   <p>
88    <xsl:text>Telephone number: </xsl:text>
89    <xsl:value-of select="telephone"/>
90   </p>
91  </xsl:if>
92  <xsl:if test="fax">
93   <p>
94    <xsl:text>Fax number: </xsl:text>
95    <xsl:value-of select="fax"/>
96   </p>
97  </xsl:if>
98  <xsl:if test="curriculum">
99   <h2>Short Curriculum Vitae:</h2>
100   <xsl:copy-of select="curriculum/*"/>
101  </xsl:if>
102  <xsl:if test="research-interests">
103   <h2>Research Interests:</h2>
104   <xsl:copy-of select="research-interests/*"/>
105  </xsl:if>
106  <xsl:if test="selected-publication">
107   <h2>Selected Publications:</h2>
108   <ul>
109    <xsl:for-each select="selected-publication">
110     <li>
111      <a href="../../publications/{@file}.html">
112       <xsl:value-of select="document(concat('../xml/publications/',@file,'.xml'))/publication/title"/>
113      </a>
114     </li>
115    </xsl:for-each>
116   </ul>
117  </xsl:if>
118 </xsl:template>
119
120 </xsl:stylesheet>