Mercurial > repos > IBBoard.WarFoundry.API
view xsl/unitcard.xsl @ 476:81e130f3b85e
Re #417: Improve install experience
* Make hacked default path available (will need improving/replacing)
Also:
* Fix type casting issue
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 15 May 2012 20:57:29 +0100 |
parents | a33be6e995c9 |
children |
line wrap: on
line source
<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:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable> <xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/army/name"/> - Created in WarFoundry </title> <style media="all"> div#armyInfo { font-size: x-large; width: 100%; margin-bottom: 2em; } div.unitcard { border: 1px solid black; width: 75%; margin-bottom: 2em; } div.unitcard table.title { width: 100%; } div.unitcard table.title th { background-color: #999999; } table.stats { border-collapse: collapse; width: 100%;} table.lists { padding: 0px; margins: 0px; border: 1px solid black; width: 100%} table.lists th { font-size: small; font-variant: small-caps; text-align: left; } table.lists td { width: 45%; } ul.equipmentList { font-size: small; display: inline; list-style-type: none; } ul.abilityList { font-size: small; display: inline; list-style-type: none; } </style> <style media="print"> div.unitcard { page-break-inside: avoid; } div.specialrules { page-break-inside: avoid; } div.pagebreak { page-break-after: always; display: none; } </style> </head> <body> <div id="armyInfo"> Name: <xsl:value-of select="/army/name"/> <br /> Points: <xsl:value-of select="/army/pointsUsed"/> of <xsl:value-of select="/army/pointsAvailable"/> </div> <xsl:for-each select="/army/category"> <xsl:for-each select="./unit"> <div class="unitcard"> <table class="title"> <th align="left" width="50%"> <xsl:value-of select="../@type"/>:<xsl:value-of select="./@name"/> </th> <th width="25%"> Models: <xsl:value-of select="sum(.//@models)"/> </th> <th width="25%"> Points: <xsl:value-of select="./@points"/> </th> </table> <table class="stats" border="1"> <xsl:for-each select="./statLine[1]"> <tr> <xsl:for-each select="./stat"> <td> <b> <xsl:value-of select="translate(./@name,$lower,$upper)"/> </b> </td> </xsl:for-each> </tr> </xsl:for-each> <xsl:for-each select="./statLine"> <tr> <xsl:for-each select="./stat"> <td> <xsl:value-of select="./@value"/> </td> </xsl:for-each> </tr> </xsl:for-each> </table> <table class="lists"> <tr> <th> Equipment </th> <th> Abilities </th> </tr> <tr> <td> <ul class="equipmentList"> <xsl:for-each select="./equipmentItem"> <li> <xsl:value-of select="./@name"/> (<xsl:value-of select="./@count"/>) </li> </xsl:for-each> </ul> </td> <td> <ul class="abilityList"> <xsl:for-each select="./abilityItem"> <li> <xsl:value-of select="./@name"/> </li> </xsl:for-each> </ul> </td> </tr> </table> </div> </xsl:for-each> </xsl:for-each> <div class="pagebreak"></div> <div class="specialrules"> <h2>Special Rules</h2> <ul class="abilityDescriptions"> <xsl:for-each select='//abilityItem[not(@name = preceding::abilityItem/@name)]'> <li> <xsl:value-of select='@name'/> - <xsl:value-of select='@description'/> </li> </xsl:for-each> </ul> </div> </body> </html> </xsl:template> </xsl:stylesheet>