]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/site.xsl
Great changes in all the stylesheets. Every page is now generated in two
[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:copy-of select="description/*"/>
55    <xsl:if test="project">
56     <h1>Projects developed by this site related to MOWGLI:</h1>
57    </xsl:if>
58    <xsl:apply-templates select="project"/>
59   </xsl:otherwise>
60  </xsl:choose>
61 </xsl:template>
62
63 <xsl:template match="project">
64  <h2>
65   <xsl:value-of select="name"/>
66   <xsl:if test="acronym">
67    <xsl:text> (</xsl:text>
68    <xsl:value-of select="acronym"/>
69    <xsl:text>)</xsl:text>
70   </xsl:if>
71  </h2>
72  <p><a href="{url}">Visit the project home page.</a></p>
73  <p>Members of the project also involved in MOWGLI:</p>
74  <ul>
75   <xsl:for-each select="member">
76    <li>
77     <a href="../people/{@file}.html">
78      <xsl:call-template name="person-name">
79       <xsl:with-param name="file" select="@file"/>
80      </xsl:call-template>
81     </a>
82    </li>
83   </xsl:for-each>
84  </ul>
85  <xsl:copy-of select="description/*"/>
86 </xsl:template>
87
88 </xsl:stylesheet>