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