← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5430: Added xsl for report table grid / data

 

Merge authors:
  Lars Helge Øverland (larshelge)
------------------------------------------------------------
revno: 5430 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-15 12:46:46 +0100
message:
  Added xsl for report table grid / data
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl	2011-12-14 14:40:02 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl	2011-12-15 11:39:20 +0000
@@ -4,8 +4,41 @@
                 xmlns:d="http://dhis2.org/schema/dxf/2.0";
     >
 
+  <xsl:template match="d:header">
+	<th> <xsl:value-of select="d:column"/> </th>
+  </xsl:template>
+  
+  <xsl:template match="d:rows">
+	<xsl:apply-templates select="d:row"/>
+  </xsl:template>
+  
+  <xsl:template match="d:row">
+	<tr>
+	  <xsl:for-each select="d:rowData">
+		<td> <xsl:value-of select="."/> </td>
+	  </xsl:for-each>
+	</tr>
+  </xsl:template>
+	
   <xsl:template match="d:grid">
-    GRID RENDERING
+    <div class="grid">
+	  <h2>
+        <xsl:value-of select="d:title"/>
+      </h2>
+	  <h4>
+		<xsl:value-of select="d:subtitle"/>
+	  </h4>
+	  <table>
+		<thead>
+		  <tr>
+			<xsl:apply-templates select="d:headers"/>
+		  </tr>
+		</thead>
+		<tbody>
+		  <xsl:apply-templates select="d:rows"/>
+		</tbody>
+	  </table>	  
+	</div>
   </xsl:template>
 
 </xsl:stylesheet>