]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/site.xsl
Initial commit of the XML/XSLT stuff.
[helm.git] / helm / mowgli / home / xsl / site.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="1.0"
3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <xsl:output method="html"/>
6
7 <xsl:template match="/">
8  <html>
9   <head>
10    <title><xsl:value-of select="site/name"/></title>
11    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12    <link rel="stylesheet" href="../../style/mowgli.css" type="text/css"/>
13   </head>
14   <body>
15    <xsl:apply-templates/>
16   </body>
17  </html>
18 </xsl:template>
19
20 <xsl:template match="site|subsite">
21  <xsl:choose>
22   <xsl:when test="subsite">
23    <p>This is an aggregate site, whose members are:</p>
24    <ul>
25     <xsl:for-each select="subsite">
26      <li>
27       <a href="#{generate-id()}">
28        <xsl:value-of select="name"/>
29       </a>
30      </li>
31     </xsl:for-each>
32    </ul>
33    <xsl:for-each select="subsite">
34     <hr />
35     <a name="{generate-id()}"/>
36     <xsl:apply-templates select="."/>
37    </xsl:for-each>
38   </xsl:when>
39   <xsl:otherwise>
40    <h1><xsl:value-of select="name"/></h1>
41    <h2><xsl:value-of select="country"/></h2>
42    <p><xsl:value-of select="address"/></p>
43    <p><a href="{url}">Visit the institution home page.</a></p>
44    <p>
45     <xsl:text>Site responsible: </xsl:text>
46     <a href="../people/{responsible/@file}.html">
47      <xsl:value-of select="responsible/@file"/>
48     </a>
49     <xsl:text>.</xsl:text>
50    </p>
51    <xsl:copy-of select="description/*"/>
52    <xsl:if test="project">
53     <h1>Projects developed by this site related to MOWGLI:</h1>
54    </xsl:if>
55    <xsl:apply-templates select="project"/>
56   </xsl:otherwise>
57  </xsl:choose>
58 </xsl:template>
59
60 <xsl:template match="project">
61  <h2>
62   <xsl:value-of select="name"/>
63   <xsl:if test="acronym">
64    <xsl:text> (</xsl:text>
65    <xsl:value-of select="acronym"/>
66    <xsl:text>)</xsl:text>
67   </xsl:if>
68  </h2>
69  <p><a href="{url}">Visit the project home page.</a></p>
70  <p>Members of the project also involved in MOWGLI:</p>
71  <ul>
72   <xsl:for-each select="member">
73    <li>
74     <a href="../people/{@file}.html">
75      <xsl:value-of select="@file"/>
76     </a>
77    </li>
78   </xsl:for-each>
79  </ul>
80  <xsl:copy-of select="description/*"/>
81 </xsl:template>
82
83 </xsl:stylesheet>