]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/site.xsl
ocaml 3.09 transition
[helm.git] / helm / mowgli / home / xsl / site.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="/">
11  <html>
12   <head>
13    <title><xsl:value-of select="site/name"/></title>
14   </head>
15   <body>
16     <xsl:apply-templates/>
17   </body>
18  </html>
19 </xsl:template>
20
21 <xsl:template match="site|subsite">
22  <xsl:choose>
23   <xsl:when test="subsite">
24    <p>This is an aggregate site, whose members are:</p>
25    <ul>
26     <xsl:for-each select="subsite">
27      <li>
28       <a href="#{generate-id()}">
29        <xsl:value-of select="name"/>
30       </a>
31      </li>
32     </xsl:for-each>
33    </ul>
34    <xsl:for-each select="subsite">
35     <hr />
36     <a name="{generate-id()}"/>
37     <xsl:apply-templates select="."/>
38    </xsl:for-each>
39   </xsl:when>
40   <xsl:otherwise>
41    <h1><xsl:value-of select="name"/></h1>
42    <h2><xsl:value-of select="country"/></h2>
43    <p><xsl:value-of select="address"/></p>
44    <p><a href="{url}">Visit the institution home page.</a></p>
45    <p>
46     <xsl:text>Site responsible: </xsl:text>
47     <a href="../people/{responsible/@file}.html">
48      <xsl:call-template name="person-name">
49       <xsl:with-param name="file" select="responsible/@file"/>
50      </xsl:call-template>
51     </a>
52     <xsl:text>.</xsl:text>
53    </p>
54    <xsl:if test="./member">
55     <p>Site members:</p>
56     <ul>
57      <xsl:for-each select="./member">
58       <li>
59        <a href="../people/{@file}.html">
60         <xsl:call-template name="person-name">
61          <xsl:with-param name="file" select="@file"/>
62         </xsl:call-template>
63        </a>
64       </li>
65      </xsl:for-each>
66     </ul>
67    </xsl:if>
68    <xsl:copy-of select="description/*"/>
69    <xsl:if test="project">
70     <h1>Projects developed by this site related to MOWGLI:</h1>
71    </xsl:if>
72    <xsl:apply-templates select="project"/>
73   </xsl:otherwise>
74  </xsl:choose>
75 </xsl:template>
76
77 <xsl:template match="project">
78  <h2>
79   <xsl:value-of select="name"/>
80   <xsl:if test="acronym">
81    <xsl:text> (</xsl:text>
82    <xsl:value-of select="acronym"/>
83    <xsl:text>)</xsl:text>
84   </xsl:if>
85  </h2>
86  <p><a href="{url}">Visit the project home page.</a></p>
87  <p>Members of the project also involved in MOWGLI:</p>
88  <ul>
89   <xsl:for-each select="member">
90    <li>
91     <a href="../people/{@file}.html">
92      <xsl:call-template name="person-name">
93       <xsl:with-param name="file" select="@file"/>
94      </xsl:call-template>
95     </a>
96    </li>
97   </xsl:for-each>
98  </ul>
99  <xsl:copy-of select="description/*"/>
100 </xsl:template>
101
102 </xsl:stylesheet>