]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/people-list.xsl
Modified Files:
[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="xml"/>
9
10 <xsl:template match="people">
11  <html>
12   <head>
13    <title>People Directory</title>
14   </head>
15   <body>
16     <h1>People</h1>
17
18     <table border="0" width="100%">
19     <tr>
20     <td valign="top">
21
22     <h3><a name="#site">By Site</a></h3>
23     <xsl:apply-templates select="from">
24     </xsl:apply-templates>
25
26     </td>
27     <td valign="top">
28
29     <h3><a name="#alpha">Alphabetical</a></h3>
30     <xsl:apply-templates select="from/person" mode="alphabetical">
31       <xsl:sort select="@file"/>
32     </xsl:apply-templates>
33
34     </td>
35     </tr>
36     </table>
37   </body>
38  </html>
39 </xsl:template>
40
41 <xsl:template match="person">
42  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
43  <a href="people/{../@site}/{@file}.html">
44   <xsl:call-template name="person-name">
45    <xsl:with-param name="file" select="concat(../@site,'/',@file)"/>
46   </xsl:call-template>
47  </a>
48  <br />
49 </xsl:template>
50
51 <xsl:template match="person" mode="alphabetical">
52  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
53  <a href="people/{../@site}/{@file}.html">
54   <xsl:value-of select="$person/surname"/>
55   <xsl:text>, </xsl:text>
56   <xsl:value-of select="$person/name"/>
57  </a>
58  <br />
59 </xsl:template>
60
61 <xsl:template match="name">
62  <xsl:param name="file" select="''"/>
63  <h4><a href="sites/{$file}.html"><xsl:value-of select="."/></a></h4>
64 </xsl:template>
65
66 <xsl:template match="from">
67  <xsl:variable name="site" select="document(concat('../xml/sites/',@site,'.xml'))/site"/>
68  <xsl:apply-templates select="$site/name | $site/subsite[1]/name">
69   <xsl:with-param name="file" select="@site"/>
70  </xsl:apply-templates>
71  <xsl:apply-templates select="person"/>
72 </xsl:template>
73
74 </xsl:stylesheet>