annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
2 <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"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
3 <xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
4 <xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
5 <xsl:template match="/">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
6 <html>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
7 <head>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
8 <title>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
9 <xsl:value-of select="/army/name"/> - Created in WarFoundry
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
10 </title>
407
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
11 <style media="all">
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
12 div#armyInfo { font-size: x-large; width: 100%; margin-bottom: 2em; }
407
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
13 div.unitcard { border: 1px solid black; width: 75%; margin-bottom: 2em; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
14 div.unitcard table.title { width: 100%; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
15 div.unitcard table.title th { background-color: #999999; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
16 table.stats { border-collapse: collapse; width: 100%;}
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
17 table.lists { padding: 0px; margins: 0px; border: 1px solid black; width: 100%}
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
18 table.lists th { font-size: small; font-variant: small-caps; text-align: left; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
19 table.lists td { width: 45%; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
20 ul.equipmentList { font-size: small; display: inline; list-style-type: none; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
21 ul.abilityList { font-size: small; display: inline; list-style-type: none; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
22 </style>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
23 <style media="print">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
24 div.unitcard { page-break-inside: avoid; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
25 div.specialrules { page-break-inside: avoid; }
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
26 div.pagebreak { page-break-after: always; display: none; }
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
27 </style>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
28 </head>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
29 <body>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
30 <div id="armyInfo">
407
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
31 Name: <xsl:value-of select="/army/name"/> <br />
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
32 Points: <xsl:value-of select="/army/pointsUsed"/> of
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
33 <xsl:value-of select="/army/pointsAvailable"/>
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
34 </div>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
35 <xsl:for-each select="/army/category">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
36 <xsl:for-each select="./unit">
407
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
37 <div class="unitcard">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
38 <table class="title">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
39 <th align="left" width="50%">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
40 <xsl:value-of select="../@type"/>:<xsl:value-of select="./@name"/>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
41 </th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
42 <th width="25%">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
43 Models: <xsl:value-of select="sum(.//@models)"/>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
44 </th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
45 <th width="25%">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
46 Points: <xsl:value-of select="./@points"/>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
47 </th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
48 </table>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
49 <table class="stats" border="1">
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
50 <xsl:for-each select="./statLine[1]">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
51 <tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
52 <xsl:for-each select="./stat">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
53 <td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
54 <b>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
55 <xsl:value-of select="translate(./@name,$lower,$upper)"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
56 </b>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
57 </td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
58 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
59 </tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
60 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
61 <xsl:for-each select="./statLine">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
62 <tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
63 <xsl:for-each select="./stat">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
64 <td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
65 <xsl:value-of select="./@value"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
66 </td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
67 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
68 </tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
69 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
70 </table>
407
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
71 <table class="lists">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
72 <tr>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
73 <th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
74 Equipment
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
75 </th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
76 <th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
77 Abilities
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
78 </th>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
79 </tr>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
80 <tr>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
81 <td>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
82 <ul class="equipmentList">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
83 <xsl:for-each select="./equipmentItem">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
84 <li>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
85 <xsl:value-of select="./@name"/> (<xsl:value-of select="./@count"/>)
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
86 </li>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
87 </xsl:for-each>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
88 </ul>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
89 </td>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
90 <td>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
91 <ul class="abilityList">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
92 <xsl:for-each select="./abilityItem">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
93 <li>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
94 <xsl:value-of select="./@name"/>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
95 </li>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
96 </xsl:for-each>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
97 </ul>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
98 </td>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
99 </tr>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
100 </table>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
101 </div>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
102 </xsl:for-each>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
103 </xsl:for-each>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
104 <div class="pagebreak"></div>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
105 <div class="specialrules">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
106 <h2>Special Rules</h2>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
107 <ul class="abilityDescriptions">
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
108 <xsl:for-each select='//abilityItem[not(@name = preceding::abilityItem/@name)]'>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
109 <li>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
110 <xsl:value-of select='@name'/> - <xsl:value-of select='@description'/>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
111 </li>
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
112 </xsl:for-each>
407
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
113 </ul>
a33be6e995c9 Finalized the layout and HTML elements.
Dan@Prey
parents: 403
diff changeset
114 </div>
403
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
115 </body>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
116 </html>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
117 </xsl:template>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
118 </xsl:stylesheet>