Fix testmodule for jhbuild autobuild
[jhbuild.git] / modulesets / moduleset.xsl
blobc2e7f7ab6538d67a044c1ba09c71e92da3872a2f
1 <?xml version='1.0'?> <!--*- mode: nxml -*-->
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 version="1.0">
5 <xsl:output method="html" encoding="ISO-8859-1" indent="yes" />
6 <xsl:key name="module-id" match="moduleset/*" use="@id" />
8 <xsl:template match="/">
9 <html>
10 <head>
11 <title>Module Set</title>
12 <style type="text/css">
13 <xsl:text>
14 dl {
15 -moz-column-width: 40em;
16 -moz-column-gap: 2em;
18 dt {
19 font-weight: bold;
20 background: #8f8;
21 display: inline;
22 padding: 0 1ex;
24 dt.metamodule {
25 background: #F08080;
27 dt.tarball {
28 background: #EEDD82;
30 dd {
31 font-size: smaller;
33 dd {
34 margin-bottom: 0.5em;
36 th {
37 text-align: left;
38 vertical-align: top;
40 ul.patches {
41 list-style: none;
42 padding: 0;
43 margin: 0;
45 </xsl:text>
46 </style>
47 </head>
48 <body>
49 <xsl:apply-templates />
50 </body>
51 </html>
52 </xsl:template>
54 <xsl:template match="moduleset">
55 <h1>JHBuild Module Set</h1>
56 <dl>
57 <xsl:apply-templates />
58 </dl>
59 </xsl:template>
61 <xsl:template match="dependencies|suggests|after">
62 <xsl:variable name="deps" select="dep/@package" />
63 <xsl:for-each select="$deps">
64 <a href="#{generate-id(key('module-id', .))}">
65 <xsl:value-of select="." />
66 </a>
67 <xsl:if test="not($deps[last()] = .)">
68 <xsl:text>, </xsl:text>
69 </xsl:if>
70 </xsl:for-each>
71 </xsl:template>
73 <xsl:template match="moduleset/*">
74 <xsl:param name="reponame">
75 <xsl:choose>
76 <xsl:when test="branch/@repo"><xsl:value-of select="branch/@repo"/></xsl:when>
77 <xsl:otherwise>
78 <xsl:value-of select="//repository[@default = 'yes']/@name"/>
79 </xsl:otherwise>
80 </xsl:choose>
81 </xsl:param>
83 <dt id="{generate-id(.)}">
84 <xsl:attribute name="class">module
85 <xsl:if test="name(.) = 'tarball' or
86 //repository[@name = $reponame]/@type = 'tarball'">tarball</xsl:if>
87 </xsl:attribute>
88 <xsl:value-of select="@id" />
89 </dt>
91 <dd>
92 <table>
93 <tr>
94 <th>Module:</th>
95 <td>
96 <xsl:choose>
97 <xsl:when test="@module">
98 <xsl:value-of select="@module" />
99 </xsl:when>
100 <xsl:otherwise>
101 <xsl:value-of select="@id" />
102 </xsl:otherwise>
103 </xsl:choose>
104 <xsl:if test="branch/@revision">
105 <xsl:text> revision: </xsl:text>
106 <xsl:value-of select="branch/@revision" />
107 </xsl:if>
108 </td>
109 </tr>
110 <xsl:if test="name(.) = 'tarball' or //repository[@name = $reponame]/@type = 'tarball'">
111 <tr>
112 <th>URL:</th>
113 <td>
114 <xsl:variable name="url">
115 <xsl:choose>
116 <xsl:when test="name(.) = 'tarball'">
117 <xsl:value-of select="source/@href"/>
118 </xsl:when>
119 <xsl:otherwise>
120 <xsl:value-of select="//repository[@name=$reponame]/@href"
121 /><xsl:value-of select="branch/@module"/>
122 </xsl:otherwise>
123 </xsl:choose>
124 </xsl:variable>
125 <a href="{$url}"><xsl:value-of select="$url"/></a>
126 <xsl:if test="branch/@size"> (<xsl:value-of select="branch/@size"/> bytes)</xsl:if>
127 <xsl:if test="source/@size"> (<xsl:value-of select="source/@size"/> bytes)</xsl:if>
128 </td>
129 </tr>
130 </xsl:if>
131 <xsl:if test="branch/patch">
132 <tr>
133 <th>Patches:</th>
134 <td>
135 <ul class="patches">
136 <xsl:apply-templates select="branch/patch"/>
137 </ul>
138 </td>
139 </tr>
140 </xsl:if>
141 <xsl:if test="@checkoutdir">
142 <tr>
143 <th>Checkout directory:</th>
144 <td><xsl:value-of select="@checkoutdir" /></td>
145 </tr>
146 </xsl:if>
147 <xsl:if test="@autogenargs">
148 <tr>
149 <th>Autogen args:</th>
150 <td><xsl:value-of select="@autogenargs" /></td>
151 </tr>
152 </xsl:if>
153 <xsl:if test="dependencies/dep">
154 <tr>
155 <th>Dependencies:</th>
156 <td><xsl:apply-templates select="dependencies" /></td>
157 </tr>
158 </xsl:if>
159 <xsl:if test="suggests">
160 <tr>
161 <th>Suggests:</th>
162 <td><xsl:apply-templates select="suggests" /></td>
163 </tr>
164 </xsl:if>
165 <xsl:if test="after">
166 <tr>
167 <th>After:</th>
168 <td><xsl:apply-templates select="after" /></td>
169 </tr>
170 </xsl:if>
171 </table>
172 </dd>
173 </xsl:template>
175 <xsl:template match="moduleset/repository|moduleset/include">
176 </xsl:template>
178 <xsl:template match="moduleset/metamodule">
179 <dt id="{generate-id(.)}" class="metamodule"><xsl:value-of select="@id" /></dt>
180 <dd>
181 <table>
182 <xsl:if test="dependencies/dep">
183 <tr>
184 <th>Dependencies:</th>
185 <td><xsl:apply-templates select="dependencies" /></td>
186 </tr>
187 </xsl:if>
188 </table>
189 </dd>
190 </xsl:template>
192 <xsl:template match="patch">
193 <li><xsl:value-of select="@file" /></li>
194 </xsl:template>
196 </xsl:stylesheet>