]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/publications-index.xsl
- added publication index
[helm.git] / helm / mowgli / home / xsl / publications-index.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="html"/>
9
10 <xsl:template match="publications">
11  <html>
12   <head>
13    <title>List of Publications</title>
14    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15    <link rel="stylesheet" href="../../style/mowgli.css" type="text/css"/>
16   </head>
17   <body>
18     <xsl:call-template name="head">
19      <xsl:with-param name="path_to_top" select="'..'"/>
20     </xsl:call-template>
21     <h1>Publications</h1>
22     <h2>About MoWGLI</h2>
23     <xsl:apply-templates select="project"/>
24     <h2>Related Publications</h2>
25     <xsl:apply-templates select="related"/>
26     <xsl:call-template name="foot">
27      <xsl:with-param name="path_to_top" select="'..'"/>
28     </xsl:call-template>
29   </body>
30  </html>
31 </xsl:template>
32
33 <xsl:template match="project">
34   <xsl:choose>
35     <xsl:when test="entry">
36       <ul>
37         <xsl:apply-templates select="entry">
38           <xsl:with-param name="section" select="'mowgli'"/>
39         </xsl:apply-templates>
40       </ul>
41     </xsl:when>
42     <xsl:otherwise>
43       None.
44     </xsl:otherwise>
45   </xsl:choose>
46 </xsl:template>
47
48 <xsl:template match="related">
49   <xsl:choose>
50     <xsl:when test="entry">
51       <ul>
52         <xsl:apply-templates select="entry">
53           <xsl:with-param name="section" select="'others'"/>
54         </xsl:apply-templates>
55       </ul>
56     </xsl:when>
57     <xsl:otherwise>
58       None.
59     </xsl:otherwise>
60   </xsl:choose>
61 </xsl:template>
62
63 <xsl:template match="entry">
64  <xsl:param name="section" select="''"/>
65  <xsl:variable name="file" select="document(concat('../xml/publications/',$section,'/',@file,'.xml'))/publication"/>
66  <li>
67   <xsl:apply-templates select="$file/author"/>,
68   <a href="{$section}/{@file}.html">
69    <xsl:text>``</xsl:text>
70    <xsl:value-of select="$file/title"/>
71    <xsl:text>''</xsl:text>
72   </a>
73  </li>
74 </xsl:template>
75
76 <xsl:template match="author">
77  <xsl:choose>
78   <xsl:when test="@file">
79    <xsl:call-template name="person-name">
80     <xsl:with-param name="file" select="@file"/>
81    </xsl:call-template>
82   </xsl:when>
83   <xsl:otherwise>
84    <xsl:value-of select="surname"/>, <xsl:value-of select="name"/>
85   </xsl:otherwise>
86  </xsl:choose>
87  <xsl:if test="position() &lt; last()">, </xsl:if>
88 </xsl:template>
89
90 </xsl:stylesheet>
91