Guest User

Chummer Charsheet

a guest
Aug 23rd, 2012
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 36.38 KB | None | 0 0
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.     xmlns="http://www.w3.org/1999/xhtml">
  5.  
  6.  
  7.     <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
  8.         doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd" indent="yes"
  9.         media-type="application/xhtml+xml" encoding="ISO-8859-1"/>
  10.  
  11.  
  12.     <xsl:template match="/characters/character">
  13.         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  14.  
  15.             <head>
  16.                 <title>
  17.                     <xsl:value-of select="name"/>
  18.                 </title>
  19.                 <link rel="stylesheet" type="text/css" href="style.css"/>
  20.                 <style type="text/css">
  21.                     <xsl:text>
  22.                         *
  23.                         {
  24.                             overflow:auto;
  25.                         }
  26.                         body
  27.                         {
  28.                             max-width: 210mm;
  29.                             font-size: 9pt;
  30.                             font-family:sans-serif;
  31.                         }
  32.                        
  33.                         h3
  34.                         {
  35.                             margin: 0px;
  36.                             text-align: center;
  37.                         }
  38.                        
  39.                         h4
  40.                         {
  41.                             page-break-after: avoid;
  42.                             text-align: left;
  43.                         }
  44.                        
  45.                        
  46.                        
  47.                         table
  48.                         {
  49.                              border-spacing:0px;
  50.                              padding:0px;
  51.                              width: 99%;
  52.                         }
  53.                        
  54.                         table td
  55.                         {
  56.                             text-align: center;
  57.                         }
  58.                        
  59.                         table td:first-child
  60.                         {
  61.                             text-align: left;
  62.                         }
  63.                        
  64.                         td + td
  65.                         {
  66.                             padding-left: 5px;
  67.                         }
  68.                        
  69.                         ul,li {
  70.                             margin: 0em;
  71.                             padding: 0em;
  72.                         }
  73.                        
  74.                         .pagebox
  75.                         {
  76.                             border: 1px solid black;
  77.                             margin-bottom: 3px;
  78.                             page-break-inside: avoid;
  79.                             min-height: 285mm;
  80.                         }
  81.                        
  82.                         .container
  83.                         {
  84.                             border: 1px dashed black;
  85.                             margin-top: 2px;
  86.                             margin-bottom: 2px;
  87.                             width: 99%;
  88.                         }
  89.                        
  90.                         .multifloatleft
  91.                         {
  92.                             width: 99%;
  93.                             text-align: justify;
  94.                             overflow:hidden;
  95.                         }
  96.                        
  97.                         .multifloatleft > span
  98.                         {
  99.                             font-size: 1px ;
  100.                             width: 100%;
  101.                         }
  102.                                                    
  103.                         .multifloatleft > *
  104.                         {
  105.                             /*display: table-cell;*/
  106.                             display: inline-block;
  107.                             vertical-align: top;
  108.                         }
  109.                        
  110.                        
  111.                         .floatleft > *
  112.                         {
  113.                             width: 49% !important;
  114.                             float: right;
  115.                         }
  116.                        
  117.                         .floatleft > *:first-child
  118.                         {
  119.                             float: left;
  120.                         }
  121.                        
  122.                         #skillbox
  123.                         {
  124.                             column-count: 3;
  125.                             -moz-column-count: 3;
  126.                         }
  127.                        
  128.                         #qualities
  129.                         {
  130.                             width: auto; /*needs to be resized to fit into column*/
  131.                         }
  132.                        
  133.                         .t80-20 td
  134.                         {
  135.                             width: 20% !important;
  136.                         }
  137.                        
  138.                         .t80-20 td:first-child
  139.                         {
  140.                             width: 80% !important;
  141.                         }
  142.                        
  143.                         tr.specialization > td:first-child
  144.                         {
  145.                             font-style:italic;
  146.                             text-indent: 1em;
  147.                         }
  148.                        
  149.                         #defaultskills
  150.                         {
  151.                             column-width: auto;
  152.                             column-count: 4;
  153.                         }
  154.                        
  155.                         #defaultskills p,dir
  156.                         {
  157.                             margin-top: 0px;
  158.                             margin-bottom: 0px;
  159.                         }
  160.                        
  161.                         #rightofskills
  162.                         {
  163.                             width: 49%
  164.                         }
  165.                        
  166.                         .cm
  167.                         {
  168.                             padding-left:10px;
  169.                             padding-right: 10px;
  170.                         }
  171.                        
  172.                         #rightofskills > .cm
  173.                         {
  174.                             width: 32%;
  175.                         }
  176.                        
  177.                         #conditionmonitors .cm
  178.                         {
  179.                             width: 49%;
  180.                         }
  181.                        
  182.                         table#cm td
  183.                         {
  184.                             margin: 0px;
  185.                             padding: 0px;
  186.                             width: 1em;
  187.                         }
  188.                        
  189.                         #implants
  190.                         {
  191.                             width: 99%;
  192.                         }
  193.                        
  194.                         .stdtable > tr:first-child
  195.                         {
  196.                             font-variant: small-caps;
  197.                             page-break-after:avoid;
  198.                             break-after:avoid;
  199.                        
  200.                         }
  201.                         .stdtable tr > td
  202.                         {
  203.                             text-align: center;
  204.                             width:auto;
  205.                         }
  206.                        
  207.                         .stdtable tr > td:first-child
  208.                         {
  209.                             text-align: left;
  210.                             width: 50%;
  211.                         }
  212.                        
  213.                         .cmbox
  214.                         {
  215.                             float: left;
  216.                             margin: 1px;
  217.                             height: 1em;
  218.                             width: 1em;
  219.                         }
  220.                        
  221.                         #programs
  222.                         {
  223.                             column-count: 2;
  224.                             column-width: 49%;
  225.                         }
  226.                        
  227.                         h4
  228.                         {
  229.                             column-span: all;
  230.                             margin: 0px;
  231.                         }
  232.                        
  233.                         #gear
  234.                         {
  235.                             width: 99%;
  236.                             column-count: 3;
  237.                             column-gap: 1em;
  238.                             column-rule: 1px solid black;
  239.                         }
  240.                        
  241.                         #gear td:nth-child(1)
  242.                         {
  243.                             width: 55%;
  244.                         }
  245.                         #gear td:nth-child(2)
  246.                         {
  247.                             width: 20%;
  248.                         }
  249.                         #gear td:nth-child(3)
  250.                         {
  251.                             width: 25%;
  252.                         }
  253.                        
  254.                        
  255.                        
  256.                         #powers
  257.                         {
  258.                             column-count: 2;
  259.                             column-width: 49%;
  260.                         }
  261.                        
  262.                         .vehicle
  263.                         {
  264.                             width: 99%;
  265.                             border:1px solid black;
  266.                             display: inline-block;
  267.                             float: left;
  268.                             margin-left: 3px;
  269.                         }
  270.                        
  271.                        
  272.                         .vehiclestats
  273.                         {
  274.                             width: 35%;
  275.                         }
  276.                        
  277.                         .vehiclesensors
  278.                         {
  279.                             width: 24%;
  280.                         }
  281.                        
  282.                         .vehicleupgrades
  283.                         {
  284.                             width: 24%;
  285.                         }
  286.                        
  287.                         .vehiclecmblock
  288.                         {
  289.                             width: 15%;
  290.                         }
  291.                     </xsl:text>
  292.                 </style>
  293.             </head>
  294.             <body>
  295.                 <div class="pagebox">
  296.                     <h3>
  297.                         <xsl:value-of select="alias"/>
  298.                     </h3>
  299.                     <div class="floatleft">
  300.                         <xsl:call-template name="basicstats"/>
  301.                         <xsl:call-template name="identities"/>
  302.                     </div>
  303.  
  304.                     <div id="skillbox">
  305.                         <xsl:call-template name="actskills"/>
  306.                         <xsl:call-template name="attribtests"/>
  307.                         <xsl:call-template name="qualities"/>
  308.                     </div>
  309.                     <xsl:call-template name="implants"/>
  310.                     <div class="floatleft">
  311.  
  312.                         <xsl:call-template name="armour"/>
  313.  
  314.                         <xsl:call-template name="monitors"/>
  315.  
  316.  
  317.                     </div>
  318.                     <xsl:call-template name="guns"/>
  319.  
  320.                     <div class="floatleft">
  321.                         <xsl:call-template name="knives"/>
  322.                         <xsl:call-template name="ammo"/>
  323.                     </div>
  324.  
  325.  
  326.                     <xsl:call-template name="matrix"/>
  327.  
  328.                     <xsl:call-template name="magic"/>
  329.  
  330.                     <xsl:call-template name="gear"/>
  331.                 </div>
  332.  
  333.                 <xsl:if test="count(vehicles/vehicle) &gt; 0">
  334.                 <div class="pagebox">
  335.                     <xsl:call-template name="vehicles"/>
  336.                 </div>
  337.                 </xsl:if>
  338.  
  339.  
  340.  
  341.             </body>
  342.         </html>
  343.  
  344.     </xsl:template>
  345.  
  346.     <xsl:template name="basicstats">
  347.         <div id="basicstats">
  348.             <div id="demographics">
  349.                 <xsl:if test="sex/text()">
  350.                     <xsl:value-of select="sex"/>
  351.                     <xsl:text> </xsl:text>
  352.                 </xsl:if>
  353.                 <xsl:value-of select="metatype"/>
  354.            
  355.             </div>
  356.             <div id="attribblock">
  357.                 <table>
  358.                     <tr>
  359.  
  360.                         <td>Body</td>
  361.                         <td>
  362.                             <xsl:value-of select="attributes/attribute[name='BOD']/base"/>
  363.                             <xsl:if
  364.                                 test="not(attributes/attribute[name='BOD']/base = attributes/attribute[name='BOD']/total)"
  365.                                 > (<xsl:value-of select="attributes/attribute[name='BOD']/total"/>)
  366.                             </xsl:if>
  367.                         </td>
  368.                         <td>Charisma</td>
  369.                         <td>
  370.                             <xsl:value-of select="attributes/attribute[name='CHA']/base"/>
  371.                             <xsl:if
  372.                                 test="not(attributes/attribute[name='CHA']/base = attributes/attribute[name='CHA']/total)"
  373.                                 > (<xsl:value-of select="attributes/attribute[name='CHA']/total"/>)
  374.                             </xsl:if>
  375.                         </td>
  376.                         <td>Edge</td>
  377.                         <td>
  378.                             <xsl:call-template name="checkboxes">
  379.                                 <xsl:with-param name="number"
  380.                                     select="attributes/attribute[name='EDG']/total"/>
  381.                             </xsl:call-template>
  382.                         </td>
  383.                     </tr>
  384.                     <tr>
  385.                         <td>Agility</td>
  386.                         <td>
  387.                             <xsl:value-of select="attributes/attribute[name='AGI']/base"/>
  388.                             <xsl:if
  389.                                 test="not(attributes/attribute[name='AGI']/base = attributes/attribute[name='AGI']/total)"
  390.                                 > (<xsl:value-of select="attributes/attribute[name='AGI']/total"/>)
  391.                             </xsl:if>
  392.                         </td>
  393.                         <td>Intuition</td>
  394.                         <td>
  395.                             <xsl:value-of select="attributes/attribute[name='INT']/base"/>
  396.                             <xsl:if
  397.                                 test="not(attributes/attribute[name='INT']/base = attributes/attribute[name='INT']/total)"
  398.                                 > (<xsl:value-of select="attributes/attribute[name='INT']/total"/>)
  399.                             </xsl:if>
  400.                         </td>
  401.                         <td>Essence</td>
  402.                         <td>
  403.                             <xsl:value-of select="attributes/attribute[name='ESS']/base"/>
  404.                         </td>
  405.                     </tr>
  406.                     <tr>
  407.                         <td>Reaction</td>
  408.                         <td>
  409.                             <xsl:value-of select="attributes/attribute[name='REA']/base"/>
  410.                             <xsl:if
  411.                                 test="not(attributes/attribute[name='REA']/base = attributes/attribute[name='REA']/total)"
  412.                                 > (<xsl:value-of select="attributes/attribute[name='REA']/total"/>)
  413.                             </xsl:if>
  414.                         </td>
  415.                         <td>Logic</td>
  416.                         <td>
  417.                             <xsl:value-of select="attributes/attribute[name='LOG']/base"/>
  418.                             <xsl:if
  419.                                 test="not(attributes/attribute[name='LOG']/base = attributes/attribute[name='LOG']/total)"
  420.                                 > (<xsl:value-of select="attributes/attribute[name='LOG']/total"/>)
  421.                             </xsl:if>
  422.                         </td>
  423.                         <xsl:choose>
  424.                             <xsl:when test="/characters/character/magenabled = 'True'">
  425.                                 <td>Magic</td>
  426.                                 <td>
  427.                                     <xsl:value-of select="attributes/attribute[name='MAG']/base"/>
  428.                                     <xsl:if
  429.                                         test="not(attributes/attribute[name='MAG']/base = attributes/attribute[name='MAG']/total)"
  430.                                         > (<xsl:value-of
  431.                                             select="attributes/attribute[name='STR']/total"/>)
  432.                                     </xsl:if>
  433.                                 </td>
  434.                             </xsl:when>
  435.                             <xsl:when test="/characters/character/resenabled = 'True'">
  436.                                 <td>Resonance</td>
  437.                                 <td>
  438.                                     <xsl:value-of select="attributes/attribute[name='RES']/base"/>
  439.                                     <xsl:if
  440.                                         test="not(attributes/attribute[name='RES']/base = attributes/attribute[name='RES']/total)"
  441.                                         > (<xsl:value-of
  442.                                             select="attributes/attribute[name='RES']/total"/>)
  443.                                     </xsl:if>
  444.                                 </td>
  445.                             </xsl:when>
  446.                             <xsl:otherwise>
  447.                                 <td>Initiative</td>
  448.                                 <td>
  449.                                     <xsl:value-of select="/characters/character/init/base"/>
  450.                                     <xsl:if
  451.                                         test="not(/characters/character/init/base = /characters/character/init/total)"
  452.                                         > (<xsl:value-of select="/characters/character/init/total"
  453.                                         />) </xsl:if> /<xsl:value-of
  454.                                         select="/characters/character/ip/total"/>&#160;IP </td>
  455.                             </xsl:otherwise>
  456.                         </xsl:choose>
  457.  
  458.  
  459.                     </tr>
  460.                     <tr>
  461.                         <td>Strength</td>
  462.                         <td>
  463.                             <xsl:value-of select="attributes/attribute[name='STR']/base"/>
  464.                             <xsl:if
  465.                                 test="not(attributes/attribute[name='STR']/base = attributes/attribute[name='STR']/total)"
  466.                                 > (<xsl:value-of select="attributes/attribute[name='STR']/total"/>)
  467.                             </xsl:if>
  468.                         </td>
  469.                         <td>Willpower</td>
  470.                         <td>
  471.                             <xsl:value-of select="attributes/attribute[name='WIL']/base"/>
  472.                             <xsl:if
  473.                                 test="not(attributes/attribute[name='WIL']/base = attributes/attribute[name='WIL']/total)"
  474.                                 > (<xsl:value-of select="attributes/attribute[name='WIL']/total"/>)
  475.                             </xsl:if>
  476.                         </td>
  477.                         <xsl:if
  478.                             test="/characters/character/magenabled = 'True' or /characters/character/resenabled = 'True'">
  479.                             <td>Initiative</td>
  480.                             <td>
  481.                                 <xsl:value-of select="/characters/character/init/base"/>
  482.                                 <xsl:if
  483.                                     test="not(/characters/character/init/base = /characters/character/init/total)"
  484.                                     > (<xsl:value-of select="/characters/character/init/total"/>)
  485.                                 </xsl:if> /<xsl:value-of select="/characters/character/ip/total"
  486.                                 />&#160;IP </td>
  487.                         </xsl:if>
  488.                     </tr>
  489.                 </table>
  490.             </div>
  491.        
  492.             <xsl:choose>
  493.                 <xsl:when test="technomancer='True'">
  494.                     Technomancer (<xsl:value-of select="stream"/>, Fading <xsl:value-of select="drain"/>)
  495.                 </xsl:when>
  496.                 <xsl:when test="adept='True' and magician='False'">
  497.                     Adept. Mentor
  498.                 </xsl:when>
  499.                 <xsl:when test="adept='False' and magician='True'">
  500.                     Magician (<xsl:value-of select="tradition"/>, Drain <xsl:value-of select="drain"/>)
  501.                 </xsl:when>
  502.                 <xsl:when test="adept='True' and magician='True'">
  503.                     Mystic Adept (<xsl:value-of select="tradition"/>, Drain <xsl:value-of select="drain"/>)
  504.                 </xsl:when>
  505.             </xsl:choose>
  506.        
  507.         </div>
  508.     </xsl:template>
  509.  
  510.     <xsl:template name="identities">
  511.         <div id="identities">
  512.             <strong>Identities:</strong>
  513.             <ul>
  514.                 <li>
  515.                     <xsl:if test="name/text()">
  516.                         <xsl:value-of select="name"/> (real) </xsl:if>
  517.                     <xsl:if test="not (name/text())">
  518.                         <b>REAL NAME UNKNOWN</b>
  519.                     </xsl:if>
  520.  
  521.                 </li>
  522.                 <xsl:for-each select="gears/gear[name='Fake SIN']">
  523.                     <li>
  524.                         <xsl:value-of select="extra"/> (Rating <xsl:value-of select="rating"/>)
  525.                             <xsl:if test="children/gear[name='Fake License']"> Licenses:
  526.                                 <xsl:for-each select="children/gear[name='Fake License']">
  527.                                 <xsl:value-of select="extra"/> (Rating <xsl:value-of select="rating"
  528.                                 />) </xsl:for-each>
  529.                         </xsl:if>
  530.                     </li>
  531.                 </xsl:for-each>
  532.             </ul>
  533.         </div>
  534.     </xsl:template>
  535.  
  536.     <xsl:template name="actskills">
  537.         <h4>Skills</h4>
  538.  
  539.         <xsl:for-each select="skills/skill[knowledge = 'False' and (rating + ratingmod) &gt; 0]">
  540.             <xsl:sort select="rating" order="descending"/>
  541.             <table class="t80-20">
  542.                 <tr>
  543.                     <td>
  544.                         <xsl:value-of select="name"/>
  545.                     </td>
  546.                     <td>
  547.                         <xsl:value-of select="rating + ratingmod"/>
  548.                     </td>
  549.                 </tr>
  550.                 <xsl:if test="spec/text()">
  551.                     <xsl:variable name="temp1" select="rating + 2"/>
  552.                     <tr class="specialization">
  553.                         <td>
  554.                             <xsl:value-of select="spec"/>
  555.                         </td>
  556.                         <td>
  557.                             <xsl:value-of select="$temp1"/>
  558.                         </td>
  559.                     </tr>
  560.                 </xsl:if>
  561.             </table>
  562.         </xsl:for-each>
  563.  
  564.         <table>
  565.             <tr>
  566.                 <td>
  567.                     <strong>Knowledge Skills</strong>
  568.                 </td>
  569.             </tr>
  570.         </table>
  571.  
  572.         <xsl:for-each select="skills/skill[skillcategory = 'Language']">
  573.             <table class="t80-20">
  574.                 <tr>
  575.                     <td>
  576.                         <xsl:value-of select="name"/>
  577.                     </td>
  578.                     <xsl:choose>
  579.                         <xsl:when test="rating = 0">
  580.                             <td>N</td>
  581.                         </xsl:when>
  582.                         <xsl:otherwise>
  583.                             <td>
  584.                                 <xsl:value-of select="rating + ratingmod"/>
  585.                             </td>
  586.                         </xsl:otherwise>
  587.                     </xsl:choose>
  588.                 </tr>
  589.                 <xsl:if test="spec/text()">
  590.                     <xsl:variable name="temp1" select="rating + 2"/>
  591.                     <tr class="specialization">
  592.                         <td>
  593.                             <xsl:value-of select="spec"/>
  594.                         </td>
  595.                         <td>
  596.                             <xsl:value-of select="$temp1"/>
  597.                         </td>
  598.                     </tr>
  599.                 </xsl:if>
  600.             </table>
  601.         </xsl:for-each>
  602.         <xsl:for-each select="skills/skill[(knowledge = 'True') and (skillcategory != 'Language')]">
  603.             <xsl:sort select="rating" order="descending"/>
  604.             <table class="t80-20">
  605.                 <tr>
  606.                     <td>
  607.                         <xsl:value-of select="name"/>
  608.                     </td>
  609.                     <td>
  610.                         <xsl:value-of select="rating + ratingmod"/>
  611.                     </td>
  612.                 </tr>
  613.                 <xsl:if test="spec/text()">
  614.                     <xsl:variable name="temp1" select="rating + 2"/>
  615.                     <tr class="specialization">
  616.                         <td>
  617.                             <xsl:value-of select="spec"/>
  618.                         </td>
  619.                         <td>
  620.                             <xsl:value-of select="$temp1"/>
  621.                         </td>
  622.                     </tr>
  623.                 </xsl:if>
  624.             </table>
  625.         </xsl:for-each>
  626.     </xsl:template>
  627.  
  628.     <xsl:template name="attribtests">
  629.         <strong>Attribute Tests</strong>
  630.         <table class="t80-20">
  631.             <tr>
  632.                 <td>Composure</td>
  633.                 <td>
  634.                     <xsl:value-of select="composure"/>
  635.                 </td>
  636.             </tr>
  637.         </table>
  638.         <table class="t80-20">
  639.             <tr>
  640.                 <td>Judge Intentions</td>
  641.                 <td>
  642.                     <xsl:value-of select="judgeintentions"/>
  643.                 </td>
  644.             </tr>
  645.         </table>
  646.         <table class="t80-20">
  647.             <tr>
  648.                 <td>Lift/Carry</td>
  649.                 <td>
  650.                     <xsl:value-of select="liftandcarry"/>
  651.                 </td>
  652.             </tr>
  653.         </table>
  654.         <table class="t80-20">
  655.             <tr>
  656.                 <td>Lift/Carry Weight</td>
  657.                 <td>
  658.                     <xsl:value-of select="liftweight"/>&#32;kg </td>
  659.             </tr>
  660.         </table>
  661.         <table class="t80-20">
  662.             <tr>
  663.                 <td>Memory</td>
  664.                 <td>
  665.                     <xsl:value-of select="memory"/>
  666.                 </td>
  667.             </tr>
  668.         </table>
  669.  
  670.  
  671.     </xsl:template>
  672.  
  673.     <xsl:template name="qualities">
  674.         <div id="qualities" class="container">
  675.             <strong>Qualities</strong>
  676.             <table class="stdtable">
  677.                 <tr>
  678.                     <td>Name</td>
  679.                     <td>BP</td>
  680.                     <td>Book</td>
  681.                 </tr>
  682.                 <xsl:for-each select="qualities/quality[qualitytype = 'Positive']">
  683.                     <xsl:sort select="bp" data-type="number" order="descending"/>
  684.                     <tr>
  685.                         <td>
  686.                             <xsl:call-template name="printname"/>
  687.                         </td>
  688.                         <td>
  689.                             <xsl:value-of select="bp"/>
  690.                         </td>
  691.                         <td>
  692.                             <xsl:call-template name="printsource"/>
  693.                         </td>
  694.                     </tr>
  695.                 </xsl:for-each>
  696.                 <!--  </table>
  697.                     <table>-->
  698.                 <xsl:for-each select="qualities/quality[qualitytype = 'Negative']">
  699.                     <xsl:sort select="bp" data-type="number" order="ascending"/>
  700.                     <tr>
  701.                         <td>
  702.                             <xsl:value-of select="name"/>
  703.                             <xsl:if test="extra/text()">
  704.                                 <xsl:text> &#8211; </xsl:text>
  705.                                 <xsl:value-of select="extra"/>
  706.                             </xsl:if>
  707.                         </td>
  708.                         <td>
  709.                             <xsl:value-of select="bp"/>
  710.                         </td>
  711.                         <td>
  712.                             <xsl:call-template name="printsource"/>
  713.                         </td>
  714.                     </tr>
  715.                 </xsl:for-each>
  716.             </table>
  717.         </div>
  718.     </xsl:template>
  719.  
  720.  
  721.  
  722.     <xsl:template name="implants">
  723.         <div id="implants" class="container">
  724.             <strong>Implants</strong>
  725.  
  726.             <table class="stdtable">
  727.                 <tr>
  728.                     <td>Name</td>
  729.                     <td>Rtg</td>
  730.                     <td>Grade</td>
  731.                     <td>Ess</td>
  732.                     <td>Book</td>
  733.                 </tr>
  734.                 <xsl:for-each select="cyberwares/cyberware">
  735.                     <tr>
  736.                         <td>
  737.                             <xsl:value-of select="location"/>
  738.                             <xsl:text> </xsl:text>
  739.                             <xsl:value-of select="name"/>
  740.                             <br/>
  741.                             <small>
  742.                                 <xsl:for-each select="children/cyberware">
  743.                                     <xsl:value-of select="name"/>
  744.                                     <xsl:if test="rating &gt; 0"> (R. <xsl:value-of select="rating"
  745.                                         />) </xsl:if>
  746.                                     <xsl:if test="following-sibling::cyberware">
  747.                                         <xsl:text>, </xsl:text>
  748.                                     </xsl:if>
  749.                                 </xsl:for-each>
  750.                             </small>
  751.  
  752.                         </td>
  753.                         <td>
  754.                             <xsl:choose>
  755.                                 <xsl:when test="maxrating &gt; 0">
  756.                                     <xsl:value-of select="rating"/>
  757.                                 </xsl:when>
  758.                                 <xsl:otherwise>
  759.                                     <xsl:text>&#8212;</xsl:text>
  760.                                 </xsl:otherwise>
  761.                             </xsl:choose>
  762.  
  763.                         </td>
  764.                         <td>
  765.                             <xsl:value-of select="grade"/>
  766.                         </td>
  767.                         <td>
  768.                             <xsl:value-of select="ess"/>
  769.                         </td>
  770.                         <td>
  771.                             <xsl:call-template name="printsource"/>
  772.                         </td>
  773.                     </tr>
  774.                 </xsl:for-each>
  775.  
  776.             </table>
  777.         </div>
  778.     </xsl:template>
  779.  
  780.     <xsl:template name="armour">
  781.         <div class="container" id="armour">
  782.             <h4>Armor</h4>
  783.             <strong>TOTAL: </strong><xsl:value-of select="armorb"/> / <xsl:value-of select="armori"/>&#160;<strong>Soak Bonus: </strong><xsl:call-template name="soakbonus"/>
  784.             <table class="stdtable">
  785.                 <tr>
  786.                     <td>Name</td>
  787.                     <td>B/I</td>
  788.                     <td>Equipped</td>
  789.                 </tr>
  790.                 <xsl:for-each select="armors/armor">
  791.                     <tr>
  792.                         <td>
  793.                             <xsl:call-template name="printname"/>
  794.                             <br/>
  795.                             <small>
  796.                                 <xsl:call-template name="printspecific">
  797.                                 <xsl:with-param name="nodelist" select="armormods/armormod"/>
  798.                                 </xsl:call-template>
  799.                             </small>
  800.                         </td>
  801.                         <td><xsl:value-of select="b"/>/<xsl:value-of select="i"/></td>
  802.                         <td>
  803.                             <xsl:if test="equipped = 'True'"> &#x2613; </xsl:if>
  804.                         </td>
  805.                     </tr>
  806.                 </xsl:for-each>
  807.             </table>
  808.         </div>
  809.     </xsl:template>
  810.  
  811.     <xsl:template name="soakbonus">
  812.         <xsl:choose>
  813.             <xsl:when test="cyberwares/cyberware[name = 'Bone Lacing (Aluminium)']"> 2 </xsl:when>
  814.             <xsl:when test="cyberwares/cyberware[name = 'Bone Lacing (Titanium)']"> 3 </xsl:when>
  815.             <xsl:when test="cyberwares/cyberware[name = 'Bone Lacing (Plastic)']"> 1 </xsl:when>
  816.             <xsl:when test="cyberwares/cyberware[name = 'Bone Lacing (Ceramic)']"> 2 </xsl:when>
  817.             <xsl:when test="cyberwares/cyberware[name = 'Bone Lacing (Kevlar)']"> 1 </xsl:when>
  818.             <xsl:when test="cyberwares/cyberware[name = 'Bone Density Agumentation']">
  819.                 <xsl:value-of select="rating"/>
  820.             </xsl:when>
  821.             <xsl:otherwise>
  822.                 <xsl:text>&#8211;</xsl:text>
  823.             </xsl:otherwise>
  824.         </xsl:choose>
  825.     </xsl:template>
  826.  
  827.  
  828.  
  829.  
  830.     <xsl:template name="monitors">
  831.         <div id="monitors" class="container">
  832.             <div class="multifloatleft">
  833.                     <div class="cm">
  834.                         <strong>Physical</strong>
  835.                         <br/>
  836.                         <xsl:call-template name="printcm">
  837.                             <xsl:with-param name="number"
  838.                                 select="physicalcm[name(..) = 'character']"/>
  839.                         </xsl:call-template>
  840.                     </div>
  841.                
  842.  
  843.                 <div class="cm">
  844.                     <strong>Overflow</strong>
  845.                     <br/>
  846.                     <xsl:call-template name="checkboxes">
  847.                         <xsl:with-param name="number"
  848.                             select="/characters/character/attributes/attribute[name = 'BOD']/total"
  849.                         />
  850.                     </xsl:call-template>
  851.                 </div>
  852.  
  853.                 <div class="cm">
  854.                     <b>Stun</b>
  855.                     <br/>
  856.                     <xsl:call-template name="printcm">
  857.                         <xsl:with-param name="number" select="stuncm"/>
  858.                     </xsl:call-template>
  859.                 </div>
  860.                
  861.                 <span>&#160;</span> <!-- Dirty CSS hack -->
  862.             </div>
  863.            
  864.         </div>
  865.     </xsl:template>
  866.  
  867.     <xsl:template name="knives">
  868.         <div id="knives" class="container">
  869.             <h4>Melee Weapons</h4>
  870.             <table class="stdtable">
  871.                 <tr>
  872.                     <td>Weapon</td>
  873.                     <td>Dmg</td>
  874.                     <td>AP</td>
  875.                     <td>Reach</td>
  876.                     <td>Book</td>
  877.                 </tr>
  878.                 <xsl:for-each select="weapons/weapon[type='Melee']">
  879.                     <tr>
  880.                         <td>
  881.                             <xsl:call-template name="printname"/>
  882.                         </td>
  883.                         <td>
  884.                             <xsl:value-of select="damage"/>
  885.                         </td>
  886.                         <td>
  887.                             <xsl:value-of select="ap"/>
  888.                         </td>
  889.                         <td>
  890.                             <xsl:value-of select="reach"/>
  891.                         </td>
  892.                         <td>
  893.                             <xsl:call-template name="printsource"/>
  894.                         </td>
  895.                     </tr>
  896.                 </xsl:for-each>
  897.  
  898.             </table>
  899.         </div>
  900.     </xsl:template>
  901.  
  902.     <xsl:template name="ammo">
  903.         <div id="ammo" class="container">
  904.             <h4>Ammunition</h4>
  905.             <table class="stdtable">
  906.                 <tr>
  907.                     <td>Name</td>
  908.                     <td>Qty</td>
  909.                     <td>Dmg</td>
  910.                     <td>AP</td>
  911.                     <td>Book</td>
  912.                 </tr>
  913.                 <xsl:for-each
  914.                     select="gears/gear[category='Ammunition'] | gears/gear[category='Explosives'] | gears/gear[category='Arrowheads']">
  915.                     <tr>
  916.                         <td>
  917.                             <xsl:call-template name="printname_noqty"/>
  918.                         </td>
  919.                         <td>
  920.                             <xsl:value-of select="qty"/>
  921.                         </td>
  922.                         <td>
  923.                             <xsl:value-of select="weaponbonusdamage"/>
  924.                         </td>
  925.                         <td>
  926.                             <xsl:value-of select="weaponbonusap"/>
  927.                         </td>
  928.                         <td>
  929.                             <xsl:call-template name="printsource"/>
  930.                         </td>
  931.                     </tr>
  932.                 </xsl:for-each>
  933.  
  934.             </table>
  935.         </div>
  936.     </xsl:template>
  937.  
  938.     <xsl:template name="guns">
  939.         <div name="guns" class="container">
  940.             <h4>Ranged Weapons</h4>
  941.             <xsl:call-template name="printguns"/>
  942.         </div>
  943.     </xsl:template>
  944.  
  945.     <xsl:template name="printguns">
  946.         <table class="stdtable">
  947.             <tr>
  948.                 <td>Weapon</td>
  949.                 <td>Dmg</td>
  950.                 <td>AP</td>
  951.                 <td>Mode</td>
  952.                 <td>RC</td>
  953.                 <td>Ammo</td>
  954.                 <td>Book</td>
  955.             </tr>
  956.  
  957.             <xsl:for-each
  958.                 select="weapons/weapon[type='Ranged' and not(starts-with(name,'Grenade:'))]">
  959.  
  960.                 <tr>
  961.                     <td>
  962.                         <xsl:call-template name="printname"/>
  963.                         <br/>
  964.                         <small>
  965.                         <xsl:call-template name="printspecific">
  966.                             <xsl:with-param name="nodelist"
  967.                                 select="mods/weaponmod | accessories/accessory | underbarrel/*"/>
  968.                         </xsl:call-template>
  969.                         </small>
  970.                     </td>
  971.                     <td>
  972.                         <xsl:value-of select="damage"/>
  973.                     </td>
  974.                     <td>
  975.                         <xsl:value-of select="ap"/>
  976.                     </td>
  977.                     <td>
  978.                         <xsl:value-of select="mode"/>
  979.                     </td>
  980.                     <td>
  981.                         <xsl:value-of select="rc"/>
  982.                     </td>
  983.                     <td>
  984.                         <xsl:value-of select="ammo"/>
  985.                     </td>
  986.                     <td>
  987.                         <xsl:call-template name="printsource"/>
  988.                     </td>
  989.                 </tr>
  990.  
  991.             </xsl:for-each>
  992.         </table>
  993.     </xsl:template>
  994.  
  995.     <xsl:template name="matrix">
  996.         <div class="floatleft">
  997.             <div id="matrixgear" class="container">
  998.                 <h4>Matrix Gear</h4>
  999.                 <table class="stdtable">
  1000.                     <tr>
  1001.                         <td>Name</td>
  1002.                         <td>Resp.</td>
  1003.                         <td>FW</td>
  1004.                         <td>Sys.</td>
  1005.                         <td>Sig.</td>
  1006.                     </tr>
  1007.                     <xsl:for-each select="gears/gear[category='Commlink']">
  1008.                         <tr>
  1009.                             <td>
  1010.                                 <xsl:call-template name="printname" />
  1011.                                
  1012.                                 <br/>
  1013.                                 <small><xsl:call-template name="printchildren"/></small>
  1014.                                
  1015.                             </td>
  1016.                             <td>
  1017.                                 <xsl:value-of select="response"/>
  1018.                             </td>
  1019.                             <td>
  1020.                                 <xsl:value-of select="firewall"/>
  1021.                             </td>
  1022.                             <td>
  1023.                                 <xsl:value-of select="system"/>
  1024.                             </td>
  1025.                             <td>
  1026.                                 <xsl:value-of select="signal"/>
  1027.                             </td>
  1028.                         </tr>
  1029.                     </xsl:for-each>
  1030.                 </table>
  1031.  
  1032.             </div>
  1033.             <div id="programs" class="container">
  1034.                 <h4>Programs</h4>
  1035.                 <table class="stdtable t80-20">
  1036.                     <tr>
  1037.                         <td>Program</td>
  1038.                         <td>Rtg.</td>
  1039.                     </tr>
  1040.                 </table>
  1041.                 <xsl:for-each
  1042.                     select="gears/gear[category='Matrix Programs'] | techprograms/techprogram | gears/gear[category='Program Packages']/children/gear">
  1043.                     <table class="t80-20">
  1044.                         <tr>
  1045.                             <td>
  1046.                                 <xsl:call-template name="printname" >
  1047.                                     <xsl:with-param name="rtg">False</xsl:with-param>
  1048.                                     <xsl:with-param name="qty">False</xsl:with-param>
  1049.                                 </xsl:call-template>
  1050.                                 <xsl:if test="name() = 'techprogram'"> (CF) </xsl:if>
  1051.                                 <br/>
  1052.                                 <small><xsl:call-template name="printchildren"/></small>
  1053.                                
  1054.                             </td>
  1055.                             <td>
  1056.                                 <xsl:value-of select="rating"/>
  1057.                             </td>
  1058.                         </tr>
  1059.                     </table>
  1060.                 </xsl:for-each>
  1061.  
  1062.             </div>
  1063.         </div>
  1064.     </xsl:template>
  1065.  
  1066.     <xsl:template name="magic">
  1067.         <xsl:if test="magician='True' or adept='True'">
  1068.             <div id="magic" class="container">
  1069.                 <xsl:if test="magician='True'">
  1070.                     <h4>Spells</h4>
  1071.                     <table class="stdtable">
  1072.                         <tr>
  1073.                             <td>Name</td>
  1074.                             <td>Damage</td>
  1075.                             <td>Type</td>
  1076.                             <td>Range</td>
  1077.                             <td>Drain</td>
  1078.                             <td>Book</td>
  1079.                         </tr>
  1080.                        
  1081.                         <xsl:for-each select="spells/spell">
  1082.                             <tr>
  1083.                                 <td>
  1084.                                     <xsl:call-template name="printname" />
  1085.                                 </td>
  1086.                                 <td><xsl:value-of select="damage"/></td>
  1087.                                 <td><xsl:value-of select="type"/></td>
  1088.                                 <td><xsl:value-of select="range"/></td>
  1089.                                 <td><xsl:value-of select="dv"/></td>
  1090.                                 <td>
  1091.                                     <xsl:call-template name="printsource"/>
  1092.                                 </td>
  1093.                             </tr>
  1094.                         </xsl:for-each>
  1095.                        
  1096.                     </table>
  1097.  
  1098.  
  1099.  
  1100.                 </xsl:if>
  1101.                 <xsl:if test="adept='True'">
  1102.                     <div id="powers">
  1103.                         <h4>Adept Powers</h4>
  1104.                         <table class="stdtable  t80-20">
  1105.                             <tr>
  1106.                                 <td>Name</td>
  1107.                                 <td>Book</td>
  1108.                             </tr>
  1109.                         </table>
  1110.                         <xsl:for-each select="powers/power">
  1111.                             <table class="t80-20">
  1112.                                 <tr>
  1113.                                     <td>
  1114.                                         <xsl:call-template name="printname" />
  1115.                                     </td>
  1116.                                     <td>
  1117.                                         <xsl:call-template name="printsource"/>
  1118.                                     </td>
  1119.                                 </tr>
  1120.                             </table>
  1121.                         </xsl:for-each>
  1122.                     </div>
  1123.                    
  1124.                 </xsl:if>
  1125.                
  1126.                
  1127.             </div>
  1128.            
  1129.         </xsl:if>
  1130.     </xsl:template>
  1131.  
  1132.     <xsl:template name="gear">
  1133.         <div id="gear" class="container">
  1134.             <table class="stdtable">
  1135.                 <tr>
  1136.                     <td>Name</td>
  1137.                     <td>Qty</td>
  1138.                     <td>Book</td>
  1139.                 </tr>
  1140.             </table>
  1141.  
  1142.             <xsl:for-each
  1143.                 select="gears/gear[not(
  1144.                 category='Ammunition' or
  1145.                 category='Program Packages' or
  1146.                 category='Arrowheads' or
  1147.                 category='Commlink' or
  1148.                 category='Matrix Programs' or
  1149.                 name='Fake SIN' )] ">
  1150.                 <table>
  1151.                     <tr>
  1152.                         <td>
  1153.                             <xsl:call-template name="printname_noqty"/>
  1154.                             <br/>
  1155.                             <small><xsl:call-template name="printchildren" /></small>
  1156.                            
  1157.                         </td>
  1158.                         <td>
  1159.                             <xsl:value-of select="qty"/>
  1160.                         </td>
  1161.                         <td>
  1162.                             <xsl:call-template name="printsource"/>
  1163.                         </td>
  1164.                     </tr>
  1165.                 </table>
  1166.             </xsl:for-each>
  1167.  
  1168.         </div>
  1169.     </xsl:template>
  1170.  
  1171.  
  1172.     <xsl:template name="checkboxes">
  1173.         <xsl:param name="number"/>
  1174.         <svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.1" class="cmbox" width="12"
  1175.             height="12">
  1176.             <svg:rect width="10" height="10" x="1" y="1" style="fill:none;stroke:black"/>
  1177.         </svg:svg>
  1178.         <xsl:variable name="next" select="$number - 1"/>
  1179.         <xsl:if test="$next &gt; 0">
  1180.             <xsl:call-template name="checkboxes">
  1181.                 <xsl:with-param name="number" select="$next"/>
  1182.             </xsl:call-template>
  1183.         </xsl:if>
  1184.     </xsl:template>
  1185.  
  1186.  
  1187.  
  1188.     <xsl:template name="printcm">
  1189.         <xsl:param name="number"/>
  1190.         <div class="cmrow">
  1191.             <xsl:choose>
  1192.                 <xsl:when test="$number &gt;= 3">
  1193.                     <xsl:call-template name="checkboxes">
  1194.                         <xsl:with-param name="number">3</xsl:with-param>
  1195.                     </xsl:call-template>
  1196.                 </xsl:when>
  1197.                 <xsl:otherwise>
  1198.                     <xsl:call-template name="checkboxes">
  1199.                         <xsl:with-param name="number" select="$number"/>
  1200.                     </xsl:call-template>
  1201.                 </xsl:otherwise>
  1202.             </xsl:choose>
  1203.         </div>
  1204.         <!-- Prepare next iteration -->
  1205.         <xsl:variable name="next" select="$number - 3"/>
  1206.         <xsl:if test="$next &gt; 0">
  1207.             <xsl:call-template name="printcm">
  1208.                 <xsl:with-param name="number" select="$next"/>
  1209.             </xsl:call-template>
  1210.         </xsl:if>
  1211.     </xsl:template>
  1212.  
  1213.     <!--
  1214.     <xsl:template name="cmrow">
  1215.         <xsl:param name="counter"/>
  1216.         &#9744;&#8201;
  1217.         <xsl:variable name="next" select="$counter - 1"/>
  1218.         <xsl:if test="$next &gt; 0">
  1219.             <xsl:call-template name="cmrow">
  1220.                 <xsl:with-param name="counter" select="$next"/>
  1221.             </xsl:call-template>
  1222.         </xsl:if>
  1223.     </xsl:template>
  1224.     -->
  1225.    
  1226.     <xsl:template name ="vehiclestats">
  1227.         <div class="vehiclestats container">
  1228.             <table>
  1229.                 <tr>
  1230.                     <td>Pilot</td>
  1231.                     <td><xsl:value-of select="pilot"/></td>
  1232.                     <td>Hand.</td>
  1233.                     <td><xsl:value-of select="handling"/></td>
  1234.                     <td>Acc.</td>
  1235.                     <td><xsl:value-of select="accel"/></td>
  1236.                     <td>Speed</td>
  1237.                     <td><xsl:value-of select="speed"/></td>
  1238.                 </tr>
  1239.                 <tr>
  1240.                     <td>Response</td>
  1241.                     <td><xsl:value-of select="response"/></td>
  1242.                     <td>System</td>
  1243.                     <td><xsl:value-of select="system"/></td>
  1244.                     <td>FW.</td>
  1245.                     <td><xsl:value-of select="firewall"/></td>
  1246.                     <td>Signal</td>
  1247.                     <td><xsl:value-of select="signal"/></td>
  1248.                 </tr>
  1249.  
  1250.             </table>
  1251.             <br/>
  1252.             <xsl:variable name="software" select="gears/gear[category='Autosofts'] | gears/gear[category='Matrix Programs']" />
  1253.             <xsl:if test="boolean($software)">
  1254.                 <strong>Software: </strong>
  1255.                 <xsl:call-template name="printspecific" >
  1256.                     <xsl:with-param name="nodelist"
  1257.                         select="$software"/>
  1258.                 </xsl:call-template>
  1259.                 <br/>
  1260.             </xsl:if>
  1261.         </div>
  1262.     </xsl:template>
  1263.    
  1264.     <xsl:template name="vehiclesensors">
  1265.         <div class="vehiclesensors container">
  1266.             <strong>
  1267.                 <xsl:value-of select="gears/gear[category='Sensors']/name"/>
  1268.             </strong>
  1269.             <xsl:text> R. </xsl:text><xsl:value-of select="sensor"/>
  1270.             <xsl:text>, Signal </xsl:text><xsl:value-of select="sensorsignal"/>
  1271.             <xsl:text>(</xsl:text>
  1272.             <xsl:call-template name="printsignalrange"><xsl:with-param name="signal" select="sensorsignal"/></xsl:call-template>
  1273.             <xsl:text>)</xsl:text>
  1274.             <br/>
  1275.             <table class="stdtable t80-20">
  1276.                 <tr>
  1277.                     <td>Sensor</td>
  1278.                     <td>Rating</td>
  1279.                 </tr>
  1280.                 <xsl:for-each select="gears/gear[category='Sensors']/children/gear">
  1281.                     <tr>
  1282.                         <td>
  1283.                             <xsl:value-of select="name"/>
  1284.                             <xsl:if test="count(children/gear) &gt; 0">
  1285.                                 <br/>
  1286.                                 <small>
  1287.                                     <xsl:call-template name="printspecific">
  1288.                                         <xsl:with-param name="nodelist"
  1289.                                             select="children/gear"/>
  1290.                                     </xsl:call-template>
  1291.                                 </small>
  1292.                             </xsl:if>
  1293.                         </td>
  1294.                         <td>
  1295.                             <xsl:value-of select="rating"/>
  1296.                         </td>
  1297.                     </tr>
  1298.                 </xsl:for-each>
  1299.                
  1300.             </table>
  1301.         </div>
  1302.        
  1303.     </xsl:template>
  1304.    
  1305.     <xsl:template name="vehicleguns">
  1306.         <xsl:if test="mods/mod[starts-with(name,'Weapon Mount')]">
  1307.             <div id="vehicleguns">
  1308.                 <b>Weapon Mounts</b>
  1309.                 <ul>
  1310.                     <xsl:for-each
  1311.                         select="mods/mod[starts-with(name,'Weapon Mount')]">
  1312.                         <li>
  1313.                             <xsl:value-of
  1314.                                 select="substring-before(substring-after(name,'('),')')"/>
  1315.                             <br/>
  1316.                             <xsl:call-template name="printguns"/>
  1317.                         </li>
  1318.                     </xsl:for-each>
  1319.                 </ul>
  1320.             </div>
  1321.         </xsl:if>
  1322.        
  1323.     </xsl:template>
  1324.     <xsl:template name="vehicleupgrades">
  1325.         <div class="vehicleupgrades container">
  1326.             <strong>Mods</strong>
  1327.             <table class="stdtable t80-20">
  1328.                 <tr>
  1329.                     <td>Name</td>
  1330.                     <td>Slots</td>
  1331.                 </tr>
  1332.                
  1333.                 <xsl:for-each select="mods/mod[not(starts-with(name,'Weapon Mount'))]">
  1334.                     <tr>
  1335.                         <td>
  1336.                             <xsl:call-template name="printname_noqty"/>
  1337.                         </td>
  1338.                         <td>
  1339.                             <xsl:choose>
  1340.                                 <xsl:when test="included = 'True'">
  1341.                                     <xsl:text>Std.</xsl:text>
  1342.                                 </xsl:when>
  1343.                                 <xsl:when test="included = 'False'">
  1344.                                     <xsl:value-of select="slots"/>
  1345.                                 </xsl:when>
  1346.                             </xsl:choose>
  1347.                         </td>
  1348.                     </tr>
  1349.                 </xsl:for-each>
  1350.             </table>
  1351.                    
  1352.         </div>
  1353.        
  1354.     </xsl:template>
  1355.  
  1356.  
  1357.  
  1358.     <xsl:template name="vehicles">
  1359.         <div id="vehicles">
  1360.             <xsl:for-each select="vehicles/vehicle">
  1361.                 <div class="container vehicle">
  1362.                     <b><xsl:value-of select="name"/></b>
  1363.                     <br/>
  1364.                     <div class="multifloatleft">
  1365.                         <xsl:call-template name="vehiclestats" />
  1366.                         <div class="vehiclecmblock container">
  1367.                             <table>
  1368.                                 <tr>
  1369.                                     <td>Body</td>
  1370.                                     <td><xsl:value-of select="body"/></td>
  1371.                                     <td>Armor</td>
  1372.                                     <td><xsl:value-of select="armor"/></td>
  1373.                                 </tr>
  1374.                             </table>
  1375.                             <div class="cm">
  1376.                                 <xsl:call-template name="printcm">
  1377.                                     <xsl:with-param name="number" select="physicalcm"/>
  1378.                                 </xsl:call-template>
  1379.                             </div>
  1380.                         </div> 
  1381.                        
  1382.                         <xsl:call-template name="vehicleupgrades" />
  1383.                         <xsl:call-template name="vehiclesensors" />
  1384.                        
  1385.                     </div>
  1386.                     <xsl:call-template name="vehicleguns" />
  1387.                        
  1388.                 </div>
  1389.             </xsl:for-each>
  1390.         </div>
  1391.     </xsl:template>
  1392.    
  1393.  
  1394.     <xsl:template name="printsignalrange">
  1395.         <xsl:param name="signal"/>
  1396.         <xsl:choose>
  1397.             <xsl:when test="$signal=0">
  1398.                 <xsl:text>3&#160;m</xsl:text>
  1399.             </xsl:when>
  1400.             <xsl:when test="$signal=1">
  1401.                 <xsl:text>40&#160;m</xsl:text>
  1402.             </xsl:when>
  1403.             <xsl:when test="$signal=2">
  1404.                 <xsl:text>100&#160;m</xsl:text>
  1405.             </xsl:when>
  1406.             <xsl:when test="$signal=3">
  1407.                 <xsl:text>400&#160;m</xsl:text>
  1408.             </xsl:when>
  1409.             <xsl:when test="$signal=4">
  1410.                 <xsl:text>1&#160;km</xsl:text>
  1411.             </xsl:when>
  1412.             <xsl:when test="$signal=5">
  1413.                 <xsl:text>4&#160;km</xsl:text>
  1414.             </xsl:when>
  1415.             <xsl:when test="$signal=6">
  1416.                 <xsl:text>10&#160;km</xsl:text>
  1417.             </xsl:when>
  1418.             <xsl:when test="$signal=7">
  1419.                 <xsl:text>40&#160;km</xsl:text>
  1420.             </xsl:when>
  1421.             <xsl:when test="$signal=8">
  1422.                 <xsl:text>100&#160;km</xsl:text>
  1423.             </xsl:when>
  1424.             <xsl:when test="$signal=9">
  1425.                 <xsl:text>400&#160;km</xsl:text>
  1426.             </xsl:when>
  1427.         </xsl:choose>
  1428.  
  1429.     </xsl:template>
  1430.  
  1431.     <xsl:template name="printsource">
  1432.         <small><i><xsl:value-of select="source"/></i>, <xsl:value-of select="page"/></small>
  1433.     </xsl:template>
  1434.    
  1435.     <xsl:template name="printval">
  1436.         <xsl:param name="val"/>
  1437.         <xsl:choose>
  1438.             <xsl:when test="$val = '' or $val = '-'">&#8211;</xsl:when>
  1439.             <xsl:otherwise>
  1440.                 <xsl:value-of select="$val"/>
  1441.             </xsl:otherwise>
  1442.         </xsl:choose>
  1443.     </xsl:template>
  1444.  
  1445.     <xsl:template name="printname">
  1446.         <xsl:param name="rtg"/>
  1447.         <xsl:param name="qty"/>
  1448.  
  1449.         <xsl:if test="qty &gt; 1 and $qty != 'False'">
  1450.             <xsl:value-of select="qty"/> * </xsl:if>
  1451.  
  1452.         <xsl:choose>
  1453.             <!-- Clean name of prefixes like "Ammo:" -->
  1454.             <xsl:when test="starts-with(name,'Ammo: ')">
  1455.                 <xsl:value-of select="substring-after(name, 'Ammo: ')"/>
  1456.             </xsl:when>
  1457.             <xsl:otherwise>
  1458.                 <xsl:value-of select="name"/>
  1459.             </xsl:otherwise>
  1460.         </xsl:choose>
  1461.  
  1462.         <xsl:if test="extra/text()"> (<xsl:value-of select="extra"/>) </xsl:if>
  1463.         <xsl:if test="rating &gt; 0 and $rtg != 'False'"> R.&#160;<xsl:value-of select="rating"/>
  1464.         </xsl:if>
  1465.  
  1466.     </xsl:template>
  1467.  
  1468.     <xsl:template name="printname_noqty">
  1469.         <xsl:call-template name="printname">
  1470.             <xsl:with-param name="qty">False</xsl:with-param>
  1471.         </xsl:call-template>
  1472.     </xsl:template>
  1473.  
  1474.     <xsl:template name="printchildren">
  1475.         <xsl:call-template name="printspecific">
  1476.             <xsl:with-param name="nodelist" select="children/*"/>
  1477.         </xsl:call-template>
  1478.     </xsl:template>
  1479.  
  1480.     <xsl:template name="printspecific">
  1481.         <xsl:param name="nodelist"/>
  1482.             <xsl:for-each select="$nodelist">
  1483.                 <xsl:if test="qty &gt; 1">
  1484.                     <xsl:value-of select="qty"/>x </xsl:if>
  1485.                 <xsl:value-of select="name"/>
  1486.                 <xsl:if test="rating &gt; 0">
  1487.                     <xsl:text> </xsl:text>
  1488.                     <xsl:value-of select="rating"/>
  1489.                 </xsl:if>
  1490.                 <xsl:if test="position() &lt; count($nodelist)">
  1491.                     <xsl:text>; </xsl:text>
  1492.                 </xsl:if>
  1493.             </xsl:for-each>
  1494.        
  1495.     </xsl:template>
  1496.  
  1497.     <xsl:template match="text()|@*"/>
  1498.  
  1499. </xsl:stylesheet>
Add Comment
Please, Sign In to add comment