/[volute]/trunk/projects/theory/snapdm/res/intermediate2xhtml.xsl
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/res/intermediate2xhtml.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 302 - (show annotations)
Mon Apr 28 15:58:36 2008 UTC (12 years, 7 months ago) by gerard.lemson
File MIME type: application/xml
File size: 12179 byte(s)
Added old xmi-to-html.xsl, structures intermediate2xhtml accordingly
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE stylesheet [
4 <!ENTITY cr "<xsl:text>
5 </xsl:text>">
6 <!ENTITY bl "<xsl:text> </xsl:text>">
7 ]>
8
9 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
11
12
13 <xsl:output method="html" encoding="UTF-8" indent="yes" />
14
15 <xsl:strip-space elements="*" />
16
17 <!-- xml index on xmlid -->
18 <xsl:key name="element" match="*//*" use="@xmiid"/>
19 <xsl:key name="package" match="*//package" use="@xmiid"/>
20
21 <!-- Input parameters -->
22 <xsl:param name="lastModified"/>
23 <xsl:param name="lastModifiedID"/>
24 <xsl:param name="lastModifiedText"/>
25
26
27
28
29 <xsl:template match="/">
30 <xsl:apply-templates select="model"/>
31 </xsl:template>
32
33
34
35
36 <xsl:template match="model">
37 <xsl:message>Model = <xsl:value-of select="name"></xsl:value-of></xsl:message>
38 <html>
39 <head>
40 <title>
41 <xsl:value-of select="name"/>
42 </title>
43 <link rel="stylesheet" href="http://ivoa.net/misc/ivoa_wg.css" type="text/css" />
44 <link rel="stylesheet" href="xmi.css" type="text/css" />
45 </head>
46 <body>
47 <div class="head">
48 <a href="http://www.ivoa.net/"><img alt="IVOA" src="http://www.ivoa.net/pub/images/IVOA_wb_300.jpg" width="300" height="169"/></a>
49 <h1>model: <xsl:value-of select="name"/><br/>
50 Version 0.x</h1>
51 <h2>IVOA Theory Interest Group <br />Internal Draft <xsl:value-of select="$lastModified"/> </h2>
52
53 <dt>This version:</dt>
54 <dd><a><xsl:attribute name="href">http://www.ivoa.net/Documents/.../<xsl:value-of select="$lastModified"/></xsl:attribute>
55 http://www.ivoa.net/Documents/.../<xsl:value-of select="$lastModified"/></a></dd>
56
57 <dt>Latest version:</dt>
58
59 <dd>NA</dd>
60
61 <dt>Previous versions:</dt>
62 <dd>NA</dd>
63
64 <dt>Theory Interest Group:</dt>
65 <dd><a href="http://www.ivoa.net/twiki/bin/view/IVOA/IvoaTheory"> http://www.ivoa.net/twiki/bin/view/IVOA/IvoaTheory</a></dd>
66 <dt>Author(s):</dt>
67 <dd>
68 ...<br /></dd>
69
70 <hr/></div>
71
72 <h2><a name="abstract" id="abstract">Abstract</a></h2>
73 <p>This Note documents the structure of the <xsl:value-of select="name"/> data model.
74 It lays out its packages with their dependencies and defines all the object types,
75 data types and enumerations with all their interrelations.
76 </p>
77
78 <div class="status">
79 <h2><a name="status" id="status">Status of this Document</a></h2>
80 This is a Note. The first release of this document was XXX. This version was generated automatically as described
81 in the Note <a href="">@@@ TODO Add title and link of relevant document@@</a>.
82 <p></p><br />
83
84 <p>This is an IVOA Note expressing suggestions from and opinions of the authors.<br/>
85 It is intended to share best practices, possible approaches, or other perspectives on interoperability with the Virtual Observatory.
86 It should not be referenced or otherwise interpreted as a standard specification.</p>
87
88
89 A list of <a href="http://www.ivoa.net/Documents/">current IVOA Recommendations and other technical documents</a> can be found at http://www.ivoa.net/Documents/.
90
91 </div><br />
92
93 <h2><a name="acknowledgments" id="acknowledgments">Acknowledgments</a></h2>
94 <p>This document was automatically generated from a UML data model serialised to
95 <a href="http://www.omg.org/technology/documents/formal/xmi.htm">XMI</a> and is meant to accompany an IVOA document describing the project
96 within which this model was created. The XSLT scripts implementing this transformation were created by Gerard Lemson and Laurent Bourges
97 can be found <a href="http://volute.googlecode.com/svn/trunk/projects/theory/snapdm/res/">here</a>.
98 For acknowledgments concerning the contents of the current model we refer the reader to the project document.
99 </p>
100 <h2><a id="contents" name="contents">Contents</a></h2>
101 <div class="head">
102 <ul class="toc">
103 <li><a href="#abstract">Abstract</a></li>
104 <li><a href="#status">Status</a></li>
105 <li><a href="#acknowledgments">Acknowledgements</a></li>
106 <li><a href="#contents">Contents</a></li>
107 <li><a href="#model">Model: <xsl:value-of select="name"/></a></li>
108 <xsl:apply-templates select="//package" mode="TOC"/>
109 </ul>
110 </div>
111 <xsl:apply-templates select="." mode="section"/>
112 <xsl:apply-templates select="//package" mode="section"/>
113
114
115
116 </body>
117 </html>
118 </xsl:template>
119
120
121
122
123 <xsl:template match="package" mode="TOC">
124 <xsl:variable name="path">
125 <xsl:call-template name="package-path">
126 <xsl:with-param name="packageid" select="@xmiid"/>
127 <xsl:with-param name="delimiter" select="'/'"/>
128 </xsl:call-template>
129 </xsl:variable>
130
131 <li><a>
132 <xsl:attribute name="href" select="concat('#',@xmiid)"/><xsl:value-of select="$path"/>
133 </a> </li>
134 </xsl:template>
135
136
137
138
139
140 <xsl:template match="model" mode="section">
141 <h2><xsl:value-of select="name"/></h2>
142 <p><xsl:value-of select="description"/></p>
143 </xsl:template>
144
145
146
147
148 <xsl:template match="package" mode="section">
149
150 <xsl:variable name="path">
151 <xsl:call-template name="package-path">
152 <xsl:with-param name="packageid" select="@xmiid"/>
153 <xsl:with-param name="delimiter" select="'/'"/>
154 </xsl:call-template>
155 </xsl:variable>
156
157 <h2><a><xsl:attribute name="name" select="@xmiid"/></a>
158 <xsl:value-of select="$path"/></h2>
159 <p>
160 <xsl:value-of select="description"/>
161 </p>
162 <xsl:if test="depends"><ul>
163 <xsl:apply-templates select="depends"/>
164 </ul>
165 </xsl:if>
166
167 <xsl:apply-templates select="objectType" />
168 <xsl:apply-templates select="dataType"/>
169 <xsl:apply-templates select="enumeration"/>
170
171 </xsl:template>
172
173
174
175
176
177 <xsl:template match="depends">
178 <li><a><xsl:attribute name="href" select="concat('#',@xmiidref)"/><xsl:value-of select="key('package',@xmiidref)/name"/></a></li>
179 </xsl:template>
180
181
182
183
184 <xsl:template match="objectType" >
185 <xsl:variable name="xmiid" select="@xmiid"/>
186 <div align="center">
187 <table border="1" width="75%" cellspacing="2">
188 <tr>
189 <td class="objecttype-title" width="20%">Object type</td>
190 <td class="objecttype-name">
191 <a name="{$xmiid}"><xsl:value-of select="name"/></a>
192 </td>
193 </tr>
194 <tr>
195 <td colspan="2" >
196 <table width="100%" cellpadding="0" cellspacing="0" border="0">
197
198 <tr>
199 <td colspan="2" bgcolor="#cacaca">
200 <table width="100%" border="0" cellpadding="3" cellspacing="1">
201
202 <xsl:apply-templates select="extends"/>
203 <xsl:apply-templates select="." mode="subclasses"/>
204
205 <xsl:if test="attribute">
206 <tr>
207 <td colspan="3" class="info-title">Attributes:</td>
208 </tr>
209 <tr>
210 <td class="feature-heading" width="35%">type</td>
211 <td class="feature-heading" width="50%">name</td>
212 <td class="feature-heading" width="15%">multiplicity</td>
213 </tr>
214
215 <xsl:apply-templates select="attribute"/>
216 </xsl:if>
217
218 <xsl:if test="reference">
219 <tr>
220 <td colspan="3" class="info-title">References:</td>
221 </tr>
222 <tr>
223 <td class="feature-heading" width="35%">type</td>
224 <td class="feature-heading" width="50%">name</td>
225 <td class="feature-heading" width="15%">multiplicity</td>
226 </tr>
227
228 <xsl:apply-templates select="reference"/>
229 </xsl:if>
230
231 <xsl:if test="collection">
232 <tr>
233 <td colspan="3" class="info-title">Collections:</td>
234 </tr>
235 <tr>
236 <td class="feature-heading" width="35%">type</td>
237 <td class="feature-heading" width="50%">name</td>
238 <td class="feature-heading" width="15%">multiplicity</td>
239 </tr>
240
241 <xsl:apply-templates select="collection"/>
242 </xsl:if>
243 </table>
244 </td>
245 </tr>
246
247 </table>
248 </td>
249 </tr>
250 </table>
251 </div>
252 </xsl:template>
253
254
255
256 <xsl:template match="objectType" mode="subclasses">
257 </xsl:template>
258
259
260
261
262 <xsl:template match="dataType">
263 <h3><a><xsl:attribute name="name" select="@xmiid"/>
264 </a>valuetype
265 <xsl:choose>
266 <xsl:when test="@abstract = 'true'">
267 <i>
268 <xsl:value-of select="name"/>
269 </i>
270 </xsl:when>
271 <xsl:otherwise>
272 <xsl:value-of select="name"/>
273 </xsl:otherwise>
274 </xsl:choose>
275 <xsl:if test="extends">
276 extends
277 <a><xsl:attribute name="href" select="concat('#',extends/@xmiidref)"/></a></xsl:if>
278 </h3>
279 <xsl:value-of select="description"/>
280
281 <xsl:if test="attribute">
282 <h4>attributes</h4><ul>
283 <xsl:apply-templates select="attribute"/>
284 </ul>
285 </xsl:if>
286 </xsl:template>
287
288
289
290
291 <xsl:template match="enumeration">
292 <h3><a><xsl:attribute name="name" select="@xmiid"/>
293 </a>enumeration
294 <xsl:value-of select="name"/>
295 <xsl:if test="extends">
296 extends
297 <a><xsl:attribute name="href" select="concat('#',extends/@xmiidref)"/></a></xsl:if>
298 </h3>
299 <xsl:value-of select="description"/>
300
301 <ul>
302 <xsl:apply-templates select="literal"/>
303 </ul>
304 </xsl:template>
305
306
307
308
309 <xsl:template match="literal" >
310 <li><xsl:value-of select="value"/> :
311 <xsl:choose>
312 <xsl:when test="description">
313 <xsl:value-of select="description"/>
314 </xsl:when>
315 <xsl:otherwise>TBD</xsl:otherwise>
316 </xsl:choose>
317 </li>
318 </xsl:template>
319
320
321
322
323 <xsl:template match="attribute">
324 <tr>
325 <td class="feature-detail">
326 <a><xsl:attribute name="href" select="concat('#',datatype/@xmiidref)"/> <xsl:value-of select="datatype/@type"/></a>
327 </td>
328 <td class="feature-detail">
329 <xsl:value-of select="name"/>
330 </td>
331 <td class="feature-detail">
332 <xsl:value-of select="multiplicity"/>
333 </td>
334 </tr>
335 </xsl:template>
336
337
338
339 <xsl:template match="reference">
340 <tr>
341 <td class="feature-detail">
342 <a><xsl:attribute name="href" select="concat('#',datatype/@xmiidref)"/> <xsl:value-of select="datatype/@class"/></a>
343 </td>
344 <td class="feature-detail">
345 <xsl:value-of select="name"/>
346 </td>
347 <td class="feature-detail">
348 <xsl:value-of select="multiplicity"/>
349 </td>
350 </tr>
351 </xsl:template>
352
353
354
355
356 <xsl:template match="collection">
357 <tr>
358 <td class="feature-detail">
359 <a><xsl:attribute name="href" select="concat('#',datatype/@xmiidref)"/> <xsl:value-of select="datatype/@class"/></a>
360 </td>
361 <td class="feature-detail">
362 <xsl:value-of select="name"/>
363 </td>
364 <td class="feature-detail">
365 <xsl:value-of select="multiplicity"/>
366 </td>
367 </tr>
368 </xsl:template>
369
370
371
372
373
374
375
376 <!-- named util templates -->
377 <!-- Calculate the full path to the package identified by the packageid
378 Use the specified delimiter. -->
379 <xsl:template name="package-path">
380 <xsl:param name="packageid"/>
381 <xsl:param name="delimiter"/>
382 <xsl:param name="suffix"/>
383
384 <xsl:variable name="p" select="key('element',$packageid)"/>
385 <xsl:choose>
386 <xsl:when test="name($p) = 'package'">
387 <xsl:variable name="newsuffix">
388 <xsl:choose>
389 <xsl:when test="$suffix">
390 <xsl:value-of select="concat($p/name,$delimiter,$suffix)"/>
391 </xsl:when>
392 <xsl:otherwise>
393 <xsl:value-of select="$p/name"/>
394 </xsl:otherwise>
395 </xsl:choose>
396 </xsl:variable>
397 <xsl:call-template name="package-path">
398 <xsl:with-param name="packageid" select="$p/../@xmiid"/>
399 <xsl:with-param name="suffix" select="$newsuffix"/>
400 <xsl:with-param name="delimiter" select="$delimiter"/>
401 </xsl:call-template>
402 </xsl:when>
403 <xsl:otherwise>
404 <xsl:value-of select="$suffix"/>
405 </xsl:otherwise>
406 </xsl:choose>
407 </xsl:template>
408
409
410
411 </xsl:stylesheet>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26