]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/work-packages_index.xsl
Another part of the proposal encoded.
[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 select="work-package"/>
35   </tbody>
36  </table>
37  <xsl:copy-of select="description/*"/>
38 </xsl:template>
39
40 <xsl:template match="work-package">
41  <xsl:variable name="work-package"
42                select="document(concat('../xml/work-packages/',@file,'.xml'))/work-package"/>
43  <tr>
44   <td valign="top">
45    <xsl:value-of select="$work-package/@number"/>.
46    <a href="{@file}.html">
47     <xsl:value-of select="$work-package/name"/>
48    </a>
49   </td>
50   <td valign="top">
51    <xsl:choose>
52     <xsl:when test="$work-package/description/tasks">
53      <xsl:apply-templates select="$work-package/description/tasks">
54       <xsl:with-param name="url" select="concat(@file,'.html')"/>
55      </xsl:apply-templates>
56     </xsl:when>
57     <xsl:otherwise>&#x00A0;</xsl:otherwise>
58    </xsl:choose>
59   </td>
60   <td valign="top">
61    <xsl:if test="$work-package/deliverable">
62     <ul>
63      <xsl:variable name="url" select="concat(@file,'.html')"/>
64      <xsl:for-each select="$work-package/deliverable[@file]">
65       <xsl:apply-templates select="document(concat('../xml/deliverables/',@file,'.xml'))/deliverable">
66        <xsl:with-param name="url" select="$url"/>
67       </xsl:apply-templates>
68      </xsl:for-each>
69     </ul>
70    </xsl:if>
71   </td>
72  </tr>
73 </xsl:template>
74
75 <xsl:template match="tasks">
76  <xsl:param name="url"/>
77  <ul>
78   <xsl:apply-templates>
79    <xsl:with-param name="url" select="$url"/>
80   </xsl:apply-templates>
81  </ul>
82 </xsl:template>
83
84 <xsl:template match="deliverable">
85  <xsl:param name="url"/>
86  <li>
87   <a href="{$url}#{@id}">
88    <xsl:value-of select="@id"/>
89    <xsl:text> </xsl:text>
90    <xsl:value-of select="name"/>
91   </a>
92  </li>
93 </xsl:template>
94
95 <xsl:template match="task">
96  <xsl:param name="url"/>
97  <li>
98   <a href="{$url}#{@id}">
99    <xsl:value-of select="@id"/>
100    <xsl:text> </xsl:text>
101    <xsl:value-of select="name"/>
102   </a>
103  </li>
104 </xsl:template>
105
106 </xsl:stylesheet>