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