]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/people-list.xsl
ocaml 3.09 transition
[helm.git] / helm / mowgli / home / xsl / people-list.xsl
index 60a5c940ba01dcc2fddee5508f5294cd0502d6a2..ab23781becee848c66093d9ba6ca2c1426256b61 100644 (file)
@@ -5,19 +5,14 @@
 
 <xsl:import href="common.xsl"/>
 
-<xsl:output method="html"/>
+<xsl:output method="xml"/>
 
 <xsl:template match="people">
  <html>
   <head>
    <title>People Directory</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>People</h1>
 
     <table border="0" width="100%">
     <td valign="top">
 
     <h3><a name="#site">By Site</a></h3>
-    <xsl:apply-templates select="from">
-      <xsl:sort select="@site"/>
-    </xsl:apply-templates>
+    <xsl:apply-templates select="from"/>
 
     </td>
     <td valign="top">
 
     <h3><a name="#alpha">Alphabetical</a></h3>
-    <xsl:apply-templates select="from/person">
+    <xsl:apply-templates select="from/person" mode="alphabetical">
       <xsl:sort select="@file"/>
     </xsl:apply-templates>
 
     </td>
     </tr>
     </table>
-
-    <xsl:call-template name="foot">
-     <xsl:with-param name="path_to_top" select="'.'"/>
-    </xsl:call-template>
   </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">
  <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
  <a href="people/{../@site}/{@file}.html">
-  <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 name="person-name">
+   <xsl:with-param name="file" select="concat(../@site,'/',@file)"/>
   </xsl:call-template>
  </a>
  <br />
 </xsl:template>
 
+<xsl:template match="person" mode="alphabetical">
+ <xsl:variable name="person" select="document(concat('../xml/people/',../@site,'/',@file,'.xml'))/person"/>
+ <a href="people/{../@site}/{@file}.html">
+  <xsl:value-of select="$person/surname"/>
+  <xsl:text>, </xsl:text>
+  <xsl:value-of select="$person/name"/>
+ </a>
+ <br />
+</xsl:template>
+
 <xsl:template match="name">
  <xsl:param name="file" select="''"/>
  <h4><a href="sites/{$file}.html"><xsl:value-of select="."/></a></h4>
@@ -85,7 +64,7 @@
 
 <xsl:template match="from">
  <xsl:variable name="site" select="document(concat('../xml/sites/',@site,'.xml'))/site"/>
- <xsl:apply-templates select="$site/name">
+ <xsl:apply-templates select="$site/name | $site/subsite[1]/name">
   <xsl:with-param name="file" select="@site"/>
  </xsl:apply-templates>
  <xsl:apply-templates select="person">
@@ -94,4 +73,3 @@
 </xsl:template>
 
 </xsl:stylesheet>
-