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