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