source: WAeUP_SRP/trunk/profiles/default/layouts/layout.xsl

Last change on this file was 3689, checked in by Henrik Bettermann, 16 years ago

New BASE and EXTENSION profiles

File size: 3.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3  <xsl:output method="html"/>
4  <xsl:template match="/">
5    <html>
6      <head>
7        <title>
8          <xsl:value-of select="object/name"/>
9        </title>
10        <link rel="stylesheet" type="text/css" media="all"
11              href="../xsl.css" />     
12      </head>
13      <body>
14        <xsl:for-each select="object">
15          <h1>Layout: <xsl:value-of select="@name"/></h1>
16        </xsl:for-each>
17        <h1>Layout</h1>
18        <table>
19          <xsl:for-each select="object/table/row">
20            <xsl:variable name="color">
21              <xsl:choose>
22                <xsl:when test="position() mod 2 = 0">
23                  <xsl:text>#ffffff</xsl:text>
24                </xsl:when>
25                <xsl:otherwise>
26                  <xsl:text>#eeeeee</xsl:text>
27                </xsl:otherwise>
28              </xsl:choose>
29            </xsl:variable>
30            <tr style="background-color:{$color}">
31              <xsl:for-each select="cell">
32              <td>
33                <xsl:value-of select="@name"/>
34              </td>
35              </xsl:for-each>
36            </tr>
37          </xsl:for-each>
38        </table>
39        <h1>Properties</h1>
40        <table>
41          <tr>
42            <th>Id</th>
43            <th>Text</th>
44          </tr>
45          <xsl:for-each select="object/property">
46            <xsl:variable name="color">
47              <xsl:choose>
48                <xsl:when test="position() mod 2 = 0">
49                  <xsl:text>#ffffff</xsl:text>
50                </xsl:when>
51                <xsl:otherwise>
52                  <xsl:text>#eeeeee</xsl:text>
53                </xsl:otherwise>
54              </xsl:choose>
55            </xsl:variable>
56            <tr style="background-color:{$color}">
57              <td>
58                <xsl:value-of select="@name"/>
59              </td>
60              <td>
61                <xsl:value-of select="text()"/>
62              </td>
63            </tr>
64          </xsl:for-each>
65        </table>
66        <h1>Widgets</h1>
67        <xsl:for-each select="object/widget">
68          <xsl:sort select="@name"
69                    order="ascending" />
70          <xsl:variable name="color">
71            <xsl:choose>
72              <xsl:when test="position() mod 2 = 0">
73                <xsl:text>#ffffff</xsl:text>
74              </xsl:when>
75              <xsl:otherwise>
76                <xsl:text>#eeeeee</xsl:text>
77              </xsl:otherwise>
78            </xsl:choose>
79          </xsl:variable>
80          <h3><xsl:value-of select="@name"/> : <xsl:value-of select="@meta_type"/></h3>
81          <table>
82            <tr style="background-color:{$color}">
83              <th colspan="3">
84                Properties:
85              </th>
86            </tr>
87            <xsl:for-each select="property">
88              <tr style="background-color:{$color}">
89                <td>
90                  <xsl:value-of select="@name"/>
91                </td>
92                <td>
93                  <xsl:choose>
94                    <xsl:when test="@name='vocabulary'">
95                      <a href="../vocabularies/{text()}.xml"><xsl:value-of select="text()"/></a>
96                    </xsl:when>
97                    <xsl:otherwise>
98                      <xsl:value-of select="text()"/>
99                    </xsl:otherwise>
100                  </xsl:choose>
101                </td>
102                <td>
103                  <xsl:for-each select="element">
104                    <xsl:value-of select="@value"/>,
105                  </xsl:for-each>
106                     
107                </td>
108              </tr>
109            </xsl:for-each>
110          </table>
111        </xsl:for-each>
112      </body>
113    </html>
114  </xsl:template>
115</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.