]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/work-packages_index.xsl
ocaml 3.09 transition
[helm.git] / helm / mowgli / home / xsl / work-packages_index.xsl
index a9a711be261e479450508e5f2d024c5492ea2495..d13fd454ad23deb3851eb4006aee87880e966524 100644 (file)
@@ -5,39 +5,99 @@
 
 <xsl:import href="common.xsl"/>
 
-<xsl:output method="html"/>
+<xsl:output method="xml"/>
 
 <xsl:template match="/">
  <html>
   <head>
    <title>Work Packages</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/>
+    <xsl:apply-templates/>
   </body>
  </html>
 </xsl:template>
 
 <xsl:template match="work-packages">
  <h1>Work Packages</h1>
- <table>
-  <xsl:apply-templates/>
+ <table border="1">
+  <thead>
+   <tr>
+    <td>Work Package:</td>
+    <td>Tasks:</td>
+    <td>Deliverables:</td>
+   </tr>
+  </thead>
+  <tbody>
+   <xsl:apply-templates select="work-package"/>
+  </tbody>
  </table>
+ <xsl:copy-of select="description/*"/>
 </xsl:template>
 
 <xsl:template match="work-package">
  <xsl:variable name="work-package"
                select="document(concat('../xml/work-packages/',@file,'.xml'))/work-package"/>
  <tr>
-  <td><xsl:value-of select="$work-package/@number"/>.</td>
-  <td>
+  <td valign="top">
+   <xsl:value-of select="$work-package/@number"/>.
    <a href="{@file}.html">
     <xsl:value-of select="$work-package/name"/>
    </a>
   </td>
+  <td valign="top">
+   <xsl:choose>
+    <xsl:when test="$work-package/description/tasks">
+     <xsl:apply-templates select="$work-package/description/tasks">
+      <xsl:with-param name="url" select="concat(@file,'.html')"/>
+     </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>&#x00A0;</xsl:otherwise>
+   </xsl:choose>
+  </td>
+  <td valign="top">
+   <xsl:if test="$work-package/deliverable">
+    <ul>
+     <xsl:for-each select="$work-package/deliverable[@file]">
+      <xsl:apply-templates select="document(concat('../xml/deliverables/',@file,'.xml'))/deliverable">
+       <xsl:with-param name="url" select="concat('../deliverables/',@file,'.html')"/>
+      </xsl:apply-templates>
+     </xsl:for-each>
+    </ul>
+   </xsl:if>
+  </td>
  </tr>
 </xsl:template>
 
+<xsl:template match="tasks">
+ <xsl:param name="url"/>
+ <ul>
+  <xsl:apply-templates>
+   <xsl:with-param name="url" select="$url"/>
+  </xsl:apply-templates>
+ </ul>
+</xsl:template>
+
+<xsl:template match="deliverable">
+ <xsl:param name="url"/>
+ <li>
+  <a href="{$url}">
+   <xsl:value-of select="@id"/>
+   <xsl:text> </xsl:text>
+   <xsl:value-of select="name"/>
+  </a>
+ </li>
+</xsl:template>
+
+<xsl:template match="task">
+ <xsl:param name="url"/>
+ <li>
+  <a href="{$url}#{@id}">
+   <xsl:value-of select="@id"/>
+   <xsl:text> </xsl:text>
+   <xsl:value-of select="name"/>
+  </a>
+ </li>
+</xsl:template>
+
 </xsl:stylesheet>