diff gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl @ 669:ef1ff5fdab5b

Changed the xsl transformation for a parameter/measurement matrix (issue199). gnv/trunk@784 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 16 Mar 2010 10:30:13 +0000
parents 97d90e314af5
children f3f433053bdd
line wrap: on
line diff
--- a/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl	Mon Mar 15 13:46:05 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl	Tue Mar 16 10:30:13 2010 +0000
@@ -89,18 +89,25 @@
                 <table class="static">
                     <tr>
                         <td><!-- nothing here --></td>
-                        <xsl:for-each select="xform:select[1]/xform:item">
-                            <td class="matrixHeader"><xsl:value-of select="position()"/>.</td>
-                        </xsl:for-each>
+                        <!-- take the first select node to render column labels -->
+                        <xsl:apply-templates select="xform:select[1]/xform:item" mode="matrixHeader"/>
                     </tr>
+                    <!-- render matrix' body -->
                     <xsl:apply-templates select="xform:select" mode="matrix" />
                 </table>
-                <xsl:apply-templates select="xform:select[1]" mode="matrixLegend"/>
             </xsl:otherwise>
         </xsl:choose>
     </xsl:template>
 
-    <!-- template for rendering parameter matrix -->
+    <!-- rendering column headers (measurements) -->
+    <xsl:template match="xform:item" mode="matrixHeader">
+        <td class="matrixHeader">
+            <xsl:value-of select="xform:label/text()"/>
+        </td>
+    </xsl:template>
+
+
+    <!-- render the first column with parameter names into matrix -->
     <xsl:template match="xform:select" mode="matrix">
         <tr>
             <td><xsl:value-of select="@label" /></td>
@@ -108,19 +115,9 @@
         </tr>
     </xsl:template>
 
-    <!-- template for rendering parameter matrix -->
-    <xsl:template match="xform:select" mode="matrixLegend">
-        <table>
-            <xsl:for-each select="xform:item">
-                <tr>
-                    <td><xsl:value-of select="position()" />.:</td>
-                    <td><xsl:value-of select="@parameter" /></td>
-                </tr>
-            </xsl:for-each>
-        </table>
-    </xsl:template>
 
-    <!-- template for rendering parameter matrix -->
+    <!-- render checkboxes and disable checkboxes for invalid parameter 
+         measurements -->
     <xsl:template match="xform:item" mode="matrix">
         <xsl:variable name="value" select="xform:value/text()"/>
         <xsl:variable name="name" select="@ref"/>

http://dive4elements.wald.intevation.org