]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/people-list.xsl
added some stylesheets for list of people and sorting
[helm.git] / helm / mowgli / home / xsl / people-list.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="html"/>
9
10 <xsl:template match="people">
11  <html>
12   <head>
13    <title>People Directory</title>
14    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15    <link rel="stylesheet" href="../style/mowgli.css" type="text/css"/>
16   </head>
17   <body>
18     <xsl:call-template name="head">
19      <xsl:with-param name="path_to_top" select="'.'"/>
20     </xsl:call-template>
21     <h1>People</h1>
22
23     <table border="0" width="100%">
24     <tr>
25     <td valign="top">
26
27     <h3><a name="#site">By Site</a></h3>
28     <xsl:apply-templates select="from">
29       <xsl:sort select="@site"/>
30     </xsl:apply-templates>
31
32     </td>
33     <td valign="top">
34
35     <h3><a name="#alpha">Alphabetical</a></h3>
36     <xsl:apply-templates select="from/person">
37       <xsl:sort select="@file"/>
38     </xsl:apply-templates>
39
40     </td>
41     </tr>
42     </table>
43
44     <xsl:call-template name="foot">
45      <xsl:with-param name="path_to_top" select="'.'"/>
46     </xsl:call-template>
47   </body>
48  </html>
49 </xsl:template>
50
51 <xsl:template name="qualified-name">
52  <xsl:param name="qualification" select="/.."/>
53  <xsl:param name="name"/>
54  <xsl:param name="surname"/>
55  <!--
56  <xsl:if test="qualification">
57   <xsl:value-of select="$qualification"/>
58   <xsl:text> </xsl:text>
59  </xsl:if>
60  -->
61  <xsl:value-of select="$name"/>
62  <xsl:text> </xsl:text>
63  <xsl:value-of select="$surname"/>
64 </xsl:template>
65
66 <xsl:template match="person">
67  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
68  <a href="people/{../@site}/{@file}.html">
69   <xsl:call-template name="qualified-name">
70    <xsl:with-param name="qualification"
71                    select="$person/qualification"/>
72    <xsl:with-param name="name"
73                    select="$person/name"/>
74    <xsl:with-param name="surname"
75                    select="$person/surname"/>
76   </xsl:call-template>
77  </a>
78  <br />
79 </xsl:template>
80
81 <xsl:template match="name">
82  <xsl:param name="file" select="''"/>
83  <h4><a href="sites/{$file}.html"><xsl:value-of select="."/></a></h4>
84 </xsl:template>
85
86 <xsl:template match="from">
87  <xsl:variable name="site" select="document(concat('../xml/sites/',@site,'.xml'))/site"/>
88  <xsl:apply-templates select="$site/name">
89   <xsl:with-param name="file" select="@site"/>
90  </xsl:apply-templates>
91  <xsl:apply-templates select="person">
92   <xsl:sort select="@file"/>
93  </xsl:apply-templates>
94 </xsl:template>
95
96 </xsl:stylesheet>
97