]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/work-packages_index.xsl
Deliverables added.
[helm.git] / helm / mowgli / home / xsl / work-packages_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="html"/>
9
10 <xsl:template match="/">
11  <html>
12   <head>
13    <title>Work Packages</title>
14    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15    <link rel="stylesheet" href="../../style/mowgli.css" type="text/css"/>
16   </head>
17   <body>
18    <xsl:apply-templates/>
19   </body>
20  </html>
21 </xsl:template>
22
23 <xsl:template match="work-packages">
24  <h1>Work Packages</h1>
25  <table border="1">
26   <thead>
27    <tr>
28     <td>Work Package:</td>
29     <td>Tasks:</td>
30     <td>Deliverables:</td>
31    </tr>
32   </thead>
33   <tbody>
34    <xsl:apply-templates/>
35   </tbody>
36  </table>
37 </xsl:template>
38
39 <xsl:template match="work-package">
40  <xsl:variable name="work-package"
41                select="document(concat('../xml/work-packages/',@file,'.xml'))/work-package"/>
42  <tr>
43   <td valign="top">
44    <xsl:value-of select="$work-package/@number"/>.
45    <a href="{@file}.html">
46     <xsl:value-of select="$work-package/name"/>
47    </a>
48   </td>
49   <td valign="top">
50    <xsl:choose>
51     <xsl:when test="$work-package/description/tasks">
52      <xsl:apply-templates select="$work-package/description/tasks">
53       <xsl:with-param name="url" select="concat(@file,'.html')"/>
54      </xsl:apply-templates>
55     </xsl:when>
56     <xsl:otherwise>&#x00A0;</xsl:otherwise>
57    </xsl:choose>
58   </td>
59   <td valign="top">
60    <xsl:if test="$work-package/deliverable">
61     <ul>
62      <xsl:variable name="url" select="concat(@file,'.html')"/>
63      <xsl:for-each select="$work-package/deliverable[@file]">
64       <xsl:apply-templates select="document(concat('../xml/deliverables/',@file,'.xml'))/deliverable">
65        <xsl:with-param name="url" select="$url"/>
66       </xsl:apply-templates>
67      </xsl:for-each>
68     </ul>
69    </xsl:if>
70   </td>
71  </tr>
72 </xsl:template>
73
74 <xsl:template match="tasks">
75  <xsl:param name="url"/>
76  <ul>
77   <xsl:apply-templates>
78    <xsl:with-param name="url" select="$url"/>
79   </xsl:apply-templates>
80  </ul>
81 </xsl:template>
82
83 <xsl:template match="deliverable">
84  <xsl:param name="url"/>
85  <li>
86   <a href="{$url}#{@id}">
87    <xsl:value-of select="@id"/>
88    <xsl:text> </xsl:text>
89    <xsl:value-of select="name"/>
90   </a>
91  </li>
92 </xsl:template>
93
94 <xsl:template match="task">
95  <xsl:param name="url"/>
96  <li>
97   <a href="{$url}#{@id}">
98    <xsl:value-of select="@id"/>
99    <xsl:text> </xsl:text>
100    <xsl:value-of select="name"/>
101   </a>
102  </li>
103 </xsl:template>
104
105 </xsl:stylesheet>