diff xsl/default_html.xsl @ 415:131fb56da842

* Pull in various changes from IBB-Dev * Merge heads (Master had merged a branch that was also merged in IBB-Dev)
author IBBoard <dev@ibboard.co.uk>
date Wed, 31 Aug 2011 13:57:27 +0100
parents cf8fc32e020a
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xsl/default_html.xsl	Wed Aug 31 13:57:27 2011 +0100
@@ -0,0 +1,59 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" method="html" indent="yes" omit-xml-declaration="yes"/>
+<xsl:template match="/">
+  <html>
+    <head>
+      <style>
+        table, th, td { border: 1px solid #000; border-spacing: 0; border-collapse: collapse; margin: 0 }
+        table table { width: 100%; border-width: 0; margin: -2px }
+        table table td { border-width:0 1px }
+      </style>
+      <title>
+        <xsl:value-of select="/army/name"/>
+      </title>
+    </head>
+    <body>
+      <div id="armyInfo">
+        <h1>
+          <xsl:value-of select="/army/name"/> - <xsl:value-of select="/army/pointsUsed"/>pts
+        </h1>
+        <xsl:for-each select="/army/category">
+          <table>
+            <xsl:for-each select="./unit/statLine[1]">
+              <tr>
+                <xsl:for-each select="./stat">
+                  <td>
+                    <xsl:value-of select="./@name"/>
+                  </td>
+                </xsl:for-each>
+                <td>Notes</td>
+                <td>Points</td>
+              </tr>
+            </xsl:for-each>
+            <xsl:for-each select="./unit/statLine">
+              <tr>
+                <xsl:for-each select="./stat">
+                  <td>
+                    <xsl:value-of select="./@value"/>
+                  </td>
+                </xsl:for-each>
+                <td>
+                  <xsl:for-each select="../equipmentItem">
+                    <xsl:value-of select="./@name"/> (<xsl:value-of select="./@count"/>),
+                  </xsl:for-each>
+                  <xsl:for-each select="../abilityItem">
+                    <xsl:value-of select="./@name"/> (<xsl:value-of select="./@description"/>),
+                 </xsl:for-each>
+                </td>
+                <td>
+                  <xsl:value-of select="../@points"/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+        </xsl:for-each>
+      </div>
+    </body>
+  </html>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file