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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 50 - (show annotations)
Fri Aug 17 13:09:11 2007 UTC (17 years, 6 months ago) by torsten
File MIME type: application/xml
File size: 2535 byte(s)
Added xsl script for converting FormEd xml-tree to html

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 <html>
10 <head>
11 <title> Formularfelder Auflistung </title>
12 </head>
13 <body>
14 <table>
15 <tr>
16 <th>Formular Bezeichnung</th>
17 <th>Typ</th>
18 <th>Datenbank Id</th>
19 <th>Textfeld Laenge</th>
20 <th>Textfeld max. Laenge</th>
21 <th>Int min. Wert</th>
22 <th>Int max. Wert</th>
23 <th>Textbereich anz. Reihen</th>
24 <th>Textbereich anz. Spalten</th>
25 </tr>
26 <xsl:apply-templates/>
27 </table>
28 </body>
29 </html>
30 </xsl:template>
31
32 <xsl:template match="group">
33 <tr>
34 <td colspan="9">
35 <h1> <xsl:value-of select="@description"/> </h1>
36 </td>
37 </tr>
38 <xsl:apply-templates/>
39 </xsl:template>
40
41 <xsl:template match="switch">
42 <tr>
43 <td colspan="9">
44 <h2>
45 <xsl:text>{</xsl:text>
46 <xsl:value-of select="local-name()"/>
47 <xsl:text>} </xsl:text> <xsl:value-of select="@description"/>
48 </h2>
49 </td>
50 </tr>
51 <xsl:apply-templates/>
52 <tr>
53 <td colspan="9">
54 <h2>
55 <xsl:text>{/</xsl:text>
56 <xsl:value-of select="local-name()"/>
57 <xsl:text>} </xsl:text> <xsl:value-of select="@description"/>
58 </h2>
59 </td>
60 </tr>
61 </xsl:template>
62 <xsl:template match="radio|choice|checkbox">
63 <tr>
64 <td>
65 <b>
66 <xsl:text>[</xsl:text>
67 <xsl:value-of select="@description"/>
68 <xsl:text>]</xsl:text>
69 </b>
70 </td>
71 <td> <xsl:value-of select="local-name()"/> </td>
72 <td> <xsl:value-of select="@name"/> </td>
73 <td colspan="6">
74 </td>
75 </tr>
76 <xsl:apply-templates/>
77 <tr>
78 <td colspan="9">
79 <b>
80 <xsl:text>[/</xsl:text>
81 <xsl:value-of select="@description"/>
82 <xsl:text>]</xsl:text>
83 </b>
84 </td>
85 </tr>
86 </xsl:template>
87
88 <xsl:template match="text|textarea|int|date|bool">
89 <tr>
90 <td> <xsl:value-of select="@description"/> </td>
91 <td> <xsl:value-of select="local-name()"/> </td>
92 <td> <xsl:value-of select="@name"/> </td>
93 <td> <xsl:value-of select="@size"/> </td>
94 <td> <xsl:value-of select="@maxlength"/> </td>
95 <td> <xsl:value-of select="@minvalue"/> </td>
96 <td> <xsl:value-of select="@maxvalue"/> </td>
97 <td> <xsl:value-of select="@rows"/> </td>
98 <td> <xsl:value-of select="@cols"/> </td>
99 </tr>
100 </xsl:template>
101 <!-- suppress unneeded textual content -->
102 <xsl:template match="text()"/>
103 </xsl:stylesheet>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26