]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/people-list.xsl
The list of persons in the "By Site" ordering is now also
[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" mode="alphabetical">
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 match="person">
52  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
53  <a href="people/{../@site}/{@file}.html">
54   <xsl:call-template name="person-name">
55    <xsl:with-param name="file" select="concat(../@site,'/',@file)"/>
56   </xsl:call-template>
57  </a>
58  <br />
59 </xsl:template>
60
61 <xsl:template match="person" mode="alphabetical">
62  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
63  <a href="people/{../@site}/{@file}.html">
64   <xsl:value-of select="$person/surname"/>
65   <xsl:text>, </xsl:text>
66   <xsl:value-of select="$person/name"/>
67  </a>
68  <br />
69 </xsl:template>
70
71 <xsl:template match="name">
72  <xsl:param name="file" select="''"/>
73  <h4><a href="sites/{$file}.html"><xsl:value-of select="."/></a></h4>
74 </xsl:template>
75
76 <xsl:template match="from">
77  <xsl:variable name="site" select="document(concat('../xml/sites/',@site,'.xml'))/site"/>
78  <xsl:apply-templates select="$site/name | $site/subsite[1]/name">
79   <xsl:with-param name="file" select="@site"/>
80  </xsl:apply-templates>
81  <xsl:apply-templates select="person"/>
82 </xsl:template>
83
84 </xsl:stylesheet>
85