annotate xsl/unitcard.xsl @ 403:cf8fc32e020a xsl-output

preliminary xsl output
author Dan.Kulinski@dank-laptop.Global.Local
date Thu, 18 Aug 2011 11:14:14 -0600
parents
children a33be6e995c9
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>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
11 <style>
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; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
13 div.unitcard { border: 1px solid black; width: 50%; margin-bottom: 2em; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
14 div.unitcard table { width: 100%; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
15 div.unitcard table th { background-color: #999999; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
16 table.stats { border-collapse: collapse; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
17 table.stats tr { border-top: 1px solid black; border-bottom: 1px solid black; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
18 table.stats td { border-right: 1px solid black; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
19 h3 { font-size: small; font-variant: small-caps; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
20 list.equipmentList { font-size: small; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
21 list.abilityList { font-size: small; }
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
22 </style>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
23 </head>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
24 <body>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
25 <div id="armyInfo">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
26 Name: <xsl:value-of select="/army/name"/> <br />
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
27 Points: <xsl:value-of select="/army/pointsUsed"/> of
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
28 <xsl:value-of select="/army/pointsAvailable"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
29 </div>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
30 <xsl:for-each select="/army/category">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
31 <xsl:for-each select="./unit">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
32 <div class="unitcard">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
33 <table>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
34 <th align="left" width="50%">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
35 <xsl:value-of select="../@type"/>:<xsl:value-of select="./@name"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
36 </th>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
37 <th width="25%">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
38 Models: <xsl:value-of select="sum(.//@models)"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
39 </th>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
40 <th width="25%">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
41 Points: <xsl:value-of select="./@points"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
42 </th>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
43 </table>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
44 <table class="stats">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
45 <xsl:for-each select="./statLine[1]">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
46 <tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
47 <xsl:for-each select="./stat">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
48 <td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
49 <b>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
50 <xsl:value-of select="translate(./@name,$lower,$upper)"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
51 </b>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
52 </td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
53 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
54 </tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
55 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
56 <xsl:for-each select="./statLine">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
57 <tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
58 <xsl:for-each select="./stat">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
59 <td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
60 <xsl:value-of select="./@value"/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
61 </td>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
62 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
63 </tr>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
64 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
65 </table>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
66 <h3>Equipment</h3>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
67 <p>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
68 <list class="equipmentList">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
69 <xsl:for-each select="./equipmentItem">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
70 <li>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
71 <xsl:value-of select="./@name"/> (<xsl:value-of select="./@count"/>)
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
72 </li>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
73 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
74 </list>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
75 </p>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
76 </div>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
77 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
78 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
79 <h3>Special Rules</h3>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
80 <list class="abilityList">
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
81 <xsl:for-each select='//abilityItem[not(@name = preceding::abilityItem/@name)]'>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
82 <li>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
83 <xsl:value-of select='@name'/> - <xsl:value-of select='@description'/>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
84 </li>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
85 </xsl:for-each>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
86 </list>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
87 </body>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
88 </html>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
89 </xsl:template>
cf8fc32e020a preliminary xsl output
Dan.Kulinski@dank-laptop.Global.Local
parents:
diff changeset
90 </xsl:stylesheet>