/[formed]/trunk/contrib/convert-formedtree2html.xsl
ViewVC logotype

Contents of /trunk/contrib/convert-formedtree2html.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (show annotations)
Fri Aug 17 13:59:32 2007 UTC (17 years, 6 months ago) by torsten
File MIME type: application/xml
File size: 2678 byte(s)
Added docstring and meta-header to make the output of the xslt transformation
a valid html document.

1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2 <!--
3 (c) 2007 by Intevation GmbH
4 Author: Torsten Irlaender
5 Converts the Formed xml tree into csv
6 -->
7 <xsl:output indent="yes" method="html" encoding="UTF-8"/>
8 <xsl:template match="/">
9 <xsl:text disable-output-escaping="yes">
10 <![CDATA[
11 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
12 ]]>
13 </xsl:text>
14 <html>
15 <head>
16 <title> Formularfelder Auflistung </title>
17 </head>
18 <body>
19 <table>
20 <tr>
21 <th>Formular Bezeichnung</th>
22 <th>Typ</th>
23 <th>Datenbank Id</th>
24 <th>Textfeld Laenge</th>
25 <th>Textfeld max. Laenge</th>
26 <th>Int min. Wert</th>
27 <th>Int max. Wert</th>
28 <th>Textbereich anz. Reihen</th>
29 <th>Textbereich anz. Spalten</th>
30 </tr>
31 <xsl:apply-templates/>
32 </table>
33 </body>
34 </html>
35 </xsl:template>
36
37 <xsl:template match="group">
38 <tr>
39 <td colspan="9">
40 <h1> <xsl:value-of select="@description"/> </h1>
41 </td>
42 </tr>
43 <xsl:apply-templates/>
44 </xsl:template>
45
46 <xsl:template match="switch">
47 <tr>
48 <td colspan="9">
49 <h2>
50 <xsl:text>{</xsl:text>
51 <xsl:value-of select="local-name()"/>
52 <xsl:text>} </xsl:text> <xsl:value-of select="@description"/>
53 </h2>
54 </td>
55 </tr>
56 <xsl:apply-templates/>
57 <tr>
58 <td colspan="9">
59 <h2>
60 <xsl:text>{/</xsl:text>
61 <xsl:value-of select="local-name()"/>
62 <xsl:text>} </xsl:text> <xsl:value-of select="@description"/>
63 </h2>
64 </td>
65 </tr>
66 </xsl:template>
67 <xsl:template match="radio|choice|checkbox">
68 <tr>
69 <td>
70 <b>
71 <xsl:text>[</xsl:text>
72 <xsl:value-of select="@description"/>
73 <xsl:text>]</xsl:text>
74 </b>
75 </td>
76 <td> <xsl:value-of select="local-name()"/> </td>
77 <td> <xsl:value-of select="@name"/> </td>
78 <td colspan="6">
79 </td>
80 </tr>
81 <xsl:apply-templates/>
82 <tr>
83 <td colspan="9">
84 <b>
85 <xsl:text>[/</xsl:text>
86 <xsl:value-of select="@description"/>
87 <xsl:text>]</xsl:text>
88 </b>
89 </td>
90 </tr>
91 </xsl:template>
92
93 <xsl:template match="text|textarea|int|date|bool">
94 <tr>
95 <td> <xsl:value-of select="@description"/> </td>
96 <td> <xsl:value-of select="local-name()"/> </td>
97 <td> <xsl:value-of select="@name"/> </td>
98 <td> <xsl:value-of select="@size"/> </td>
99 <td> <xsl:value-of select="@maxlength"/> </td>
100 <td> <xsl:value-of select="@minvalue"/> </td>
101 <td> <xsl:value-of select="@maxvalue"/> </td>
102 <td> <xsl:value-of select="@rows"/> </td>
103 <td> <xsl:value-of select="@cols"/> </td>
104 </tr>
105 </xsl:template>
106 <!-- suppress unneeded textual content -->
107 <xsl:template match="text()"/>
108 </xsl:stylesheet>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26