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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 50 by torsten, Fri Aug 17 13:09:11 2007 UTC revision 53 by frank, Fri Aug 17 16:13:36 2007 UTC
# Line 1  Line 1 
1  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2  <!--  <!--
3    (c) 2007 by Intevation GmbH    (c) 2007 by Intevation GmbH
4          Author: Torsten Irlaender          Authors: Torsten Irlaender
5          Converts the Formed xml tree into csv                   Frank Koormann
6            Converts the Formed xml tree into html
7    
8        TODO:
9            - Verstaendliche Typenbezeichnung:
10                    radio:          Radiobutton
11                    choice:         Auswahlliste
12                    checkbox:       Checkbox
13                    text:           Textfeld
14                    textarea:       Textbereich
15                    int:            Zahl
16                    date:           Datum  
17                    bool:           s.u.
18  -->  -->
19          <xsl:output indent="yes" method="html" encoding="UTF-8"/>          <xsl:output indent="yes" method="html" encoding="UTF-8"/>
20          <xsl:template match="/">          <xsl:template match="/">
21                  <html>          <xsl:text disable-output-escaping="yes">
22                          <head>          <![CDATA[
23                                  <title> Formularfelder Auflistung </title>          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
24                          </head>          ]]>
25                          <body>          </xsl:text>
26                                  <table>          <html>
27                                  <tr>                  <head>
28                                          <th>Formular Bezeichnung</th>                          <title> Formularfelder Auflistung </title>
29                                          <th>Typ</th>                  </head>
30                                          <th>Datenbank Id</th>                  <body>
31                                          <th>Textfeld Laenge</th>                          <table>
32                                          <th>Textfeld max. Laenge</th>                          <tr>
33                                          <th>Int min. Wert</th>                                  <th>Formular Bezeichnung</th>
34                                          <th>Int max. Wert</th>                                  <th>Typ</th>
35                                          <th>Textbereich anz. Reihen</th>                                  <th>Datenbank Id</th>
36                                          <th>Textbereich anz. Spalten</th>                                  <th>Textfeld Laenge</th>
37                                  </tr>                                  <th>Textfeld max. Laenge</th>
38                                  <xsl:apply-templates/>                                  <th>Int min. Wert</th>
39                                  </table>                                  <th>Int max. Wert</th>
40                          </body>                                  <th>Textbereich anz. Reihen</th>
41                  </html>                                  <th>Textbereich anz. Spalten</th>
42                            </tr>
43                            <xsl:apply-templates/>
44                            </table>
45                    </body>
46            </html>
47          </xsl:template>          </xsl:template>
48    
49          <xsl:template match="group">          <xsl:template match="group">
50                  <tr>                  <tr>
51                          <td colspan="9">                          <td colspan="9">
52                                  <h1> <xsl:value-of select="@description"/> </h1>                                  <xsl:choose>
53                                            <xsl:when test="count(ancestor::*) = 1">
54                                                    <h1><xsl:value-of select="@description"/></h1>
55                                            </xsl:when>
56                                            <xsl:when test="count(ancestor::*) = 2">
57                                                    <h2><xsl:value-of select="@description"/></h2>
58                                            </xsl:when>
59                                            <xsl:when test="count(ancestor::*) = 3">
60                                                    <h3><xsl:value-of select="@description"/></h3>
61                                            </xsl:when>
62                                            <xsl:when test="count(ancestor::*) = 4">
63                                                    <h4><xsl:value-of select="@description"/></h4>
64                                            </xsl:when>
65                                            <xsl:when test="count(ancestor::*) = 5">
66                                                    <h5><xsl:value-of select="@description"/></h5>
67                                            </xsl:when>
68                                            <xsl:otherwise>
69                                                    <h6><xsl:value-of select="@description"/></h6>
70                                            </xsl:otherwise>
71                                    </xsl:choose>
72                          </td>                          </td>
73                  </tr>                  </tr>
74                  <xsl:apply-templates/>                  <xsl:apply-templates/>
# Line 73  Line 109 
109                          <td colspan="6">                          <td colspan="6">
110                          </td>                          </td>
111                  </tr>                  </tr>
112                  <xsl:apply-templates/>                  <xsl:apply-templates select="bool" mode="select"/>
113                  <tr>                  <tr>
114                          <td colspan="9">                          <td colspan="9">
115                                  <b>                                  <b>
# Line 98  Line 134 
134                          <td> <xsl:value-of select="@cols"/> </td>                          <td> <xsl:value-of select="@cols"/> </td>
135                  </tr>                  </tr>
136          </xsl:template>          </xsl:template>
137    
138    
139            <xsl:template match="bool" mode="select">
140                    <tr>
141                            <td></td>
142                            <td> <xsl:value-of select="@description"/> </td>
143                            <td colspan="7"></td>
144                    </tr>
145            </xsl:template>
146    
147          <!-- suppress unneeded textual content -->          <!-- suppress unneeded textual content -->
148          <xsl:template match="text()"/>          <xsl:template match="text()"/>
149  </xsl:stylesheet>  </xsl:stylesheet>

Legend:
Removed from v.50  
changed lines
  Added in v.53

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26