]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/person.xsl
Initial commit of the XML/XSLT stuff.
[helm.git] / helm / mowgli / home / xsl / person.xsl
diff --git a/helm/mowgli/home/xsl/person.xsl b/helm/mowgli/home/xsl/person.xsl
new file mode 100644 (file)
index 0000000..8323ecf
--- /dev/null
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="html"/>
+
+<xsl:template match="/">
+ <html>
+  <head>
+   <title>
+    <xsl:call-template name="qualified-name">
+     <xsl:with-param name="qualification"
+                     select="person/qualification"/>
+     <xsl:with-param name="name"
+                     select="person/name"/>
+     <xsl:with-param name="surname"
+                     select="person/surname"/>
+    </xsl:call-template>
+   </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:apply-templates/>
+  </body>
+ </html>
+</xsl:template>
+
+<xsl:template name="qualified-name">
+ <xsl:param name="qualification" select="/.."/>
+ <xsl:param name="name"/>
+ <xsl:param name="surname"/>
+ <xsl:if test="qualification">
+  <xsl:value-of select="$qualification"/>
+  <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="$name"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$surname"/>
+</xsl:template>
+
+<xsl:template match="person">
+ <h1>
+  <xsl:call-template name="qualified-name">
+   <xsl:with-param name="qualification"
+                   select="qualification"/>
+   <xsl:with-param name="name"
+                   select="name"/>
+   <xsl:with-param name="surname"
+                   select="surname"/>
+  </xsl:call-template>
+ </h1>
+ <xsl:choose>
+  <xsl:when test="count(position) &gt; 1">
+   <ul>
+    <xsl:for-each select="position">
+     <li><xsl:value-of select="."/></li>
+    </xsl:for-each>
+   </ul>
+  </xsl:when>
+  <xsl:when test="count(position) = 1">
+   <p><xsl:value-of select="position"/></p>
+  </xsl:when>
+ </xsl:choose>
+ <p>
+  <xsl:text>e-mail: </xsl:text>
+  <a href="mailto:{e-mail}">
+   <xsl:value-of select="e-mail"/>
+  </a>
+ </p>
+ <xsl:if test="url">
+  <p>
+   <xsl:text>Home Page: </xsl:text>
+   <a href="{url}">
+    <xsl:value-of select="url"/>
+   </a>
+  </p>
+ </xsl:if>
+ <xsl:if test="address">
+  <p>
+   <xsl:text>Address: </xsl:text>
+   <xsl:value-of select="address"/>
+  </p>
+ </xsl:if>
+ <xsl:if test="telephone">
+  <p>
+   <xsl:text>Telephone number: </xsl:text>
+   <xsl:value-of select="telephone"/>
+  </p>
+ </xsl:if>
+ <xsl:if test="curriculum">
+  <h2>Short Curriculum Vitae:</h2>
+  <xsl:copy-of select="curriculum/*"/>
+ </xsl:if>
+ <xsl:if test="research-interests">
+  <h2>Research Interests:</h2>
+  <xsl:copy-of select="research-interests/*"/>
+ </xsl:if>
+ <xsl:if test="selected-publication">
+  <h2>Selected Publications:</h2>
+  <ul>
+   <xsl:for-each select="selected-publication">
+    <li>
+     <a href="../../publications/{@file}.html">
+      <xsl:value-of select="@file"/>
+     </a>
+    </li>
+   </xsl:for-each>
+  </ul>
+ </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>