]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/publications-index.xsl
- added publication index
[helm.git] / helm / mowgli / home / xsl / publications-index.xsl
diff --git a/helm/mowgli/home/xsl/publications-index.xsl b/helm/mowgli/home/xsl/publications-index.xsl
new file mode 100644 (file)
index 0000000..4132b59
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="common.xsl"/>
+
+<xsl:output method="html"/>
+
+<xsl:template match="publications">
+ <html>
+  <head>
+   <title>List of Publications</title>
+   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+   <link rel="stylesheet" href="../../style/mowgli.css" type="text/css"/>
+  </head>
+  <body>
+    <xsl:call-template name="head">
+     <xsl:with-param name="path_to_top" select="'..'"/>
+    </xsl:call-template>
+    <h1>Publications</h1>
+    <h2>About MoWGLI</h2>
+    <xsl:apply-templates select="project"/>
+    <h2>Related Publications</h2>
+    <xsl:apply-templates select="related"/>
+    <xsl:call-template name="foot">
+     <xsl:with-param name="path_to_top" select="'..'"/>
+    </xsl:call-template>
+  </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="project">
+  <xsl:choose>
+    <xsl:when test="entry">
+      <ul>
+        <xsl:apply-templates select="entry">
+         <xsl:with-param name="section" select="'mowgli'"/>
+       </xsl:apply-templates>
+      </ul>
+    </xsl:when>
+    <xsl:otherwise>
+      None.
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="related">
+  <xsl:choose>
+    <xsl:when test="entry">
+      <ul>
+        <xsl:apply-templates select="entry">
+         <xsl:with-param name="section" select="'others'"/>
+       </xsl:apply-templates>
+      </ul>
+    </xsl:when>
+    <xsl:otherwise>
+      None.
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="entry">
+ <xsl:param name="section" select="''"/>
+ <xsl:variable name="file" select="document(concat('../xml/publications/',$section,'/',@file,'.xml'))/publication"/>
+ <li>
+  <xsl:apply-templates select="$file/author"/>,
+  <a href="{$section}/{@file}.html">
+   <xsl:text>``</xsl:text>
+   <xsl:value-of select="$file/title"/>
+   <xsl:text>''</xsl:text>
+  </a>
+ </li>
+</xsl:template>
+
+<xsl:template match="author">
+ <xsl:choose>
+  <xsl:when test="@file">
+   <xsl:call-template name="person-name">
+    <xsl:with-param name="file" select="@file"/>
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="surname"/>, <xsl:value-of select="name"/>
+  </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="position() &lt; last()">, </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
+