]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/people-list.xsl
ocaml 3.09 transition
[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
25     </td>
26     <td valign="top">
27
28     <h3><a name="#alpha">Alphabetical</a></h3>
29     <xsl:apply-templates select="from/person" mode="alphabetical">
30       <xsl:sort select="@file"/>
31     </xsl:apply-templates>
32
33     </td>
34     </tr>
35     </table>
36   </body>
37  </html>
38 </xsl:template>
39
40 <xsl:template match="person">
41  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
42  <a href="people/{../@site}/{@file}.html">
43   <xsl:call-template name="person-name">
44    <xsl:with-param name="file" select="concat(../@site,'/',@file)"/>
45   </xsl:call-template>
46  </a>
47  <br />
48 </xsl:template>
49
50 <xsl:template match="person" mode="alphabetical">
51  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
52  <a href="people/{../@site}/{@file}.html">
53   <xsl:value-of select="$person/surname"/>
54   <xsl:text>, </xsl:text>
55   <xsl:value-of select="$person/name"/>
56  </a>
57  <br />
58 </xsl:template>
59
60 <xsl:template match="name">
61  <xsl:param name="file" select="''"/>
62  <h4><a href="sites/{$file}.html"><xsl:value-of select="."/></a></h4>
63 </xsl:template>
64
65 <xsl:template match="from">
66  <xsl:variable name="site" select="document(concat('../xml/sites/',@site,'.xml'))/site"/>
67  <xsl:apply-templates select="$site/name | $site/subsite[1]/name">
68   <xsl:with-param name="file" select="@site"/>
69  </xsl:apply-templates>
70  <xsl:apply-templates select="person">
71   <xsl:sort select="@file"/>
72  </xsl:apply-templates>
73 </xsl:template>
74
75 </xsl:stylesheet>