Difference between revisions of "User:Victor Bearwolf/Test"

From Game Logs
Jump to: navigation, search
m (Added ammo stats in attacks section.)
(Code)
Line 77: Line 77:
 
         <xsl:call-template name="section.gear"/>
 
         <xsl:call-template name="section.gear"/>
  
<!--    Uncomment this and comment out weapons/armor/gear here and in sidemenu to replace separate equipment list with joint one  
+
<!--    Uncomment this and comment out weapons/armor/gear up there and in sidemenu to replace separate equipment list with joint one  
 
         <xsl:call-template name="section.equipment"/>  -->
 
         <xsl:call-template name="section.equipment"/>  -->
  
Line 238: Line 238:
  
 
   <xsl:template name="include.sidemenu">
 
   <xsl:template name="include.sidemenu">
     __NOTOC__<br/>
+
     {{FloatTOC|Character
    &amp;lt;div style="clear:left; float:left; margin-top:38em; margin-left:-12.9em; width:10.35em; padding:0px; position:sticky; position:-webkit-sticky; top:0.5em;"&amp;gt;<br/>
+
     <xsl:if test="description != ''">|Description</xsl:if>
    &amp;lt;h3 class="portlet" style="font-size:1em;"&amp;gt;contents&amp;lt;/h3&amp;gt;<br/>
+
     <xsl:if test="background != ''">|Background</xsl:if>
    &amp;lt;div class="toc" style="width:100%;"&amp;gt;<br/>
+
     <xsl:if test="skills/skill[knowledge = 'False']">|Active Skills</xsl:if>
    [[#Character|Character]]&amp;lt;br/&amp;gt;<br/>
+
     <xsl:if test="skills/skill[knowledge = 'True']">|Knowledge Skills</xsl:if>
     <xsl:if test="description != ''">[[#Description|Description]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
<!--<xsl:if test="skills/skill[knowledge = 'True' and islanguage = 'False']">|Knowledge Skills</xsl:if>
     <xsl:if test="background != ''">[[#Background|Background]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="skills/skill[knowledge = 'True' and islanguage = 'True']">|Languages</xsl:if>  -->
     <xsl:if test="skills/skill[knowledge = 'False']">[[#Active Skills|Active Skills]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="//*/weapon">|Attacks</xsl:if>
     <xsl:if test="skills/skill[knowledge = 'True']">[[#Knowledge Skills|Knowledge Skills]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="qualities/quality | critterpowers/critterpower[category = 'Weakness']">|Qualities</xsl:if>
<!--<xsl:if test="skills/skill[knowledge = 'True' and islanguage = 'False']">[[#Knowledge Skills|Knowledge Skills]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="powers/power | critterpowers/critterpower[category != 'Weakness']">|Powers</xsl:if>
     <xsl:if test="skills/skill[knowledge = 'True' and islanguage = 'True']">[[#Languages|Languages]]&amp;lt;br/&amp;gt;<br/></xsl:if>  -->
+
     <xsl:if test="martialarts/martialart">|Martial Arts</xsl:if>
     <xsl:if test="//*/weapon">[[#Attacks|Attacks]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="techprograms/techprogram">|Complex Forms</xsl:if>
     <xsl:if test="qualities/quality | critterpowers/critterpower[category = 'Weakness']">[[#Qualities|Qualities]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="spells/spell">|Spells</xsl:if>
     <xsl:if test="powers/power | critterpowers/critterpower[category != 'Weakness']">[[#Powers|Powers]]&amp;lt;br/&amp;gt;<br/></xsl:if>
 
     <xsl:if test="martialarts/martialart">[[#Martial Arts|Martial Arts]]&amp;lt;br/&amp;gt;<br/></xsl:if>
 
     <xsl:if test="techprograms/techprogram">[[#Complex Forms|Complex Forms]]&amp;lt;br/&amp;gt;<br/></xsl:if>
 
     <xsl:if test="spells/spell">[[#Spells|Spells]]&amp;lt;br/&amp;gt;<br/></xsl:if>
 
 
     <xsl:if test="spirits/spirit">
 
     <xsl:if test="spirits/spirit">
 
       <xsl:choose>
 
       <xsl:choose>
         <xsl:when test="technomancer = 'True'">[[#Sprites|Sprites]]</xsl:when>
+
         <xsl:when test="technomancer = 'True'">|Sprites</xsl:when>
         <xsl:otherwise>[[#Spirits|Spirits]]</xsl:otherwise>
+
         <xsl:otherwise>|Spirits</xsl:otherwise>
 
       </xsl:choose>
 
       </xsl:choose>
      &amp;lt;br/&amp;gt;<br/>
 
 
     </xsl:if>
 
     </xsl:if>
     <xsl:if test="vehicles/vehicle">[[#Vehicles and Drones|Vehicles and Drones]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="vehicles/vehicle">|Vehicles and Drones</xsl:if>
     <xsl:if test="lifestyles/lifestyle">[[#Lifestyles|Lifestyles]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="lifestyles/lifestyle">|Lifestyles</xsl:if>
     <xsl:if test="contacts/contact">[[#Contacts|Contacts]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="contacts/contact">|Contacts</xsl:if>
     <xsl:if test="//*[issin = 'True' or contains(name, 'SIN,')]">[[#SINs|SINs]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="//*[issin = 'True' or contains(name, 'SIN,')]">|SINs</xsl:if>
     <xsl:if test="//*[iscommlink = 'True' or isnexus = 'True']">[[#Commlinks|Commlinks]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="//*[iscommlink = 'True' or isnexus = 'True']">|Commlinks</xsl:if>
     <xsl:if test="weapons/weapon">[[#Weapons|Weapons]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="weapons/weapon">|Weapons</xsl:if>
     <xsl:if test="armors/armor">[[#Armor|Armor]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="armors/armor">|Armor</xsl:if>
     <xsl:if test="gears/gear[iscommlink != 'True' or isnexus != 'True']">[[#Gear|Gear]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="gears/gear[iscommlink != 'True' or isnexus != 'True']">|Gear</xsl:if>
<!--<xsl:if test="armors/armor | weapons/weapon[name != 'Unarmed Attack'] | gears/gear[not(contains(name, 'renade:'))]">[[#Equipment|Equipment]]&amp;lt;br/&amp;gt;<br/></xsl:if>  -->
+
<!--<xsl:if test="armors/armor | weapons/weapon[name != 'Unarmed Attack'] | gears/gear[not(contains(name, 'renade:'))]">|Equipment</xsl:if>  -->
     <xsl:if test="cyberwares/cyberware">[[#Augmentations|Augmentations]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="cyberwares/cyberware">|Augmentations</xsl:if>
     <xsl:if test="expenses/expense[type = 'Nuyen']">[[#Nuyen Expenses|Nuyen Expenses]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="expenses/expense[type = 'Nuyen']">|Nuyen Expenses</xsl:if>
     <xsl:if test="expenses/expense[type = 'Karma']">[[#Karma Expenses|Karma Expenses]]&amp;lt;br/&amp;gt;<br/></xsl:if>
+
     <xsl:if test="expenses/expense[type = 'Karma']">|Karma Expenses</xsl:if>
     &amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;<br/><br/>
+
     }}<br/>
 
   </xsl:template>
 
   </xsl:template>
  
Line 533: Line 528:
 
                   &amp;lt;br/&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;<xsl:value-of select="substring-after(name, ': ')"/>
 
                   &amp;lt;br/&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;<xsl:value-of select="substring-after(name, ': ')"/>
 
                   (<xsl:for-each select="/characters/character/gears/gear[name = current()/name]">
 
                   (<xsl:for-each select="/characters/character/gears/gear[name = current()/name]">
 +
                    <xsl:sort select="location"/>
 
                     <xsl:choose>
 
                     <xsl:choose>
 
                       <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
 
                       <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
Line 574: Line 570:
 
                 <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
 
                 <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
 
                   &amp;lt;br/&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;<xsl:value-of select="substring-after(name, ': ')"/>
 
                   &amp;lt;br/&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;<xsl:value-of select="substring-after(name, ': ')"/>
                   (<xsl:choose>
+
                   (<xsl:for-each select="$ammo[name = current()/name]">
                    <xsl:when test="count($ammo[name = current()/name]) &amp;gt; 1">
+
                    <xsl:sort select="location"/>
                      <xsl:for-each select="$ammo[name = current()/name]">
+
                    <xsl:choose>
                        <xsl:choose>
+
                      <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
                          <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
+
                      <xsl:otherwise>x<xsl:value-of select="qty"/></xsl:otherwise>
                          <xsl:otherwise>x<xsl:value-of select="qty"/></xsl:otherwise>
+
                    </xsl:choose>
                        </xsl:choose>
+
                    <xsl:if test="position() != last()">, </xsl:if>
                        <xsl:if test="position() != last()">, </xsl:if>
+
                  </xsl:for-each>)
                      </xsl:for-each>
 
                    </xsl:when>
 
                    <xsl:otherwise>
 
                      <xsl:choose>
 
                        <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
 
                        <xsl:otherwise>x<xsl:value-of select="qty"/></xsl:otherwise>
 
                      </xsl:choose>
 
                    </xsl:otherwise>
 
                  </xsl:choose>)
 
 
                 </xsl:if>
 
                 </xsl:if>
 
               </xsl:for-each>
 
               </xsl:for-each>
Line 644: Line 631:
 
         </xsl:choose>
 
         </xsl:choose>
 
         <xsl:text>&amp;lt;/span&amp;gt;</xsl:text>
 
         <xsl:text>&amp;lt;/span&amp;gt;</xsl:text>
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;span class="ref"&amp;gt;
 
         (<xsl:choose>
 
         (<xsl:choose>
 
           <xsl:when test="purchased = 'True'">permanent</xsl:when>
 
           <xsl:when test="purchased = 'True'">permanent</xsl:when>
Line 680: Line 667:
 
         <xsl:value-of select="extra"/>
 
         <xsl:value-of select="extra"/>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;span class="ref"&amp;gt;
 
         (<xsl:choose>
 
         (<xsl:choose>
 
           <xsl:when test="contains(name, ',')">
 
           <xsl:when test="contains(name, ',')">
Line 741: Line 728:
 
         </xsl:choose>
 
         </xsl:choose>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;span class="ref"&amp;gt;
 
         (<xsl:if test="gearname != ''"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         (<xsl:if test="gearname != ''"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         :&amp;lt;p align="justify"&amp;gt;
 
         :&amp;lt;p align="justify"&amp;gt;
Line 825: Line 812:
 
         </xsl:choose>
 
         </xsl:choose>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;span class="ref"&amp;gt;
 
         (<xsl:if test="vehiclename != ''"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         (<xsl:if test="vehiclename != ''"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         :&amp;lt;p align="justify"&amp;gt;
 
         :&amp;lt;p align="justify"&amp;gt;
Line 905: Line 892:
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
         &amp;lt;/span&amp;gt;&amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;/span&amp;gt;&amp;lt;span class="ref"&amp;gt;
 
         (<xsl:if test="(armorname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         (<xsl:if test="(armorname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         :&amp;lt;p align="justify"&amp;gt;Armor:
 
         :&amp;lt;p align="justify"&amp;gt;Armor:
Line 1,007: Line 994:
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
         &amp;lt;/span&amp;gt;&amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;/span&amp;gt;&amp;lt;span class="ref"&amp;gt;
 
         (<xsl:if test="(weaponname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         (<xsl:if test="(weaponname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         :&amp;lt;p align="justify"&amp;gt;<xsl:value-of select="type"/> Weapon:
 
         :&amp;lt;p align="justify"&amp;gt;<xsl:value-of select="type"/> Weapon:
Line 1,087: Line 1,074:
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
         &amp;lt;/span&amp;gt;&amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;/span&amp;gt;&amp;lt;span class="ref"&amp;gt;
 
         (<xsl:if test="(gearname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         (<xsl:if test="(gearname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         <xsl:if test="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft'))]">
 
         <xsl:if test="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft'))]">
Line 1,186: Line 1,173:
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
 
         <xsl:if test="qty &amp;gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
         &amp;lt;/span&amp;gt;&amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;/span&amp;gt;&amp;lt;span class="ref"&amp;gt;
 
         (<xsl:if test="(concat(armorname, weaponname, gearname) != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         (<xsl:if test="(concat(armorname, weaponname, gearname) != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         <xsl:choose>
 
         <xsl:choose>
Line 1,322: Line 1,309:
 
         (<xsl:value-of select="ess"/> Essence)
 
         (<xsl:value-of select="ess"/> Essence)
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;<br/>
 
         <xsl:if test="children/cyberware">
 
         <xsl:if test="children/cyberware">
 
           :&amp;lt;p align="justify"&amp;gt;
 
           :&amp;lt;p align="justify"&amp;gt;
Line 1,347: Line 1,334:
 
         <xsl:if test="rating &amp;gt; 0">&amp;#160;<xsl:value-of select="rating"/></xsl:if>
 
         <xsl:if test="rating &amp;gt; 0">&amp;#160;<xsl:value-of select="rating"/></xsl:if>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         <xsl:if test="notes != ''">
 
         <xsl:if test="notes != ''">
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
Line 1,359: Line 1,346:
 
         <xsl:sort select="name"/>
 
         <xsl:sort select="name"/>
 
         ;&amp;lt;span id="<xsl:value-of select="name"/>"&amp;gt;<xsl:value-of select="name"/>&amp;lt;/span&amp;gt;
 
         ;&amp;lt;span id="<xsl:value-of select="name"/>"&amp;gt;<xsl:value-of select="name"/>&amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;<br/>
 
         <xsl:if test="notes != ''">
 
         <xsl:if test="notes != ''">
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
Line 1,379: Line 1,366:
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         <xsl:if test="notes != ''">
 
         <xsl:if test="notes != ''">
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
Line 1,398: Line 1,385:
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         <xsl:if test="notes != ''">
 
         <xsl:if test="notes != ''">
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
 
           :&amp;lt;p align="justify"&amp;gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&amp;lt;/p&amp;gt;<br/>
Line 1,417: Line 1,404:
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         <xsl:if test="programoptions/programoption">
 
         <xsl:if test="programoptions/programoption">
 
           :&amp;lt;p align="justify"&amp;gt;Options:
 
           :&amp;lt;p align="justify"&amp;gt;Options:
Line 1,445: Line 1,432:
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         <xsl:if test="extra != ''">&amp;#160;(<xsl:value-of select="extra"/>)</xsl:if>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
+
         &amp;lt;span class="ref"&amp;gt; (<xsl:value-of select="source"/>&amp;#160;<xsl:value-of select="page"/>)&amp;lt;/span&amp;gt;<br/>
 
         :&amp;lt;p align="justify"&amp;gt;<xsl:value-of select="category"/> Spell<xsl:if test="descriptors != ''"> (<xsl:value-of select="descriptors"/>)</xsl:if>:
 
         :&amp;lt;p align="justify"&amp;gt;<xsl:value-of select="category"/> Spell<xsl:if test="descriptors != ''"> (<xsl:value-of select="descriptors"/>)</xsl:if>:
 
         <xsl:if test="type != ''">type <xsl:value-of select="type"/>, </xsl:if>
 
         <xsl:if test="type != ''">type <xsl:value-of select="type"/>, </xsl:if>
Line 1,468: Line 1,455:
 
         <xsl:value-of select="name"/>
 
         <xsl:value-of select="name"/>
 
         &amp;lt;/span&amp;gt;
 
         &amp;lt;/span&amp;gt;
         &amp;lt;span style="font-weight:normal; font-style:italic;"&amp;gt;
+
         &amp;lt;span class="ref"&amp;gt;
 
         <xsl:choose>
 
         <xsl:choose>
 
           <xsl:when test="type = 'Contact'">(Contact, Connection <xsl:value-of select="connection"/>, Loyalty <xsl:value-of select="loyalty"/>)<br/></xsl:when>
 
           <xsl:when test="type = 'Contact'">(Contact, Connection <xsl:value-of select="connection"/>, Loyalty <xsl:value-of select="loyalty"/>)<br/></xsl:when>

Revision as of 06:24, 30 May 2022

Notes

  • Сохранить код ниже как *.xsl файл в Chummer4\sheets\ (например D:\Shadowrun\Chummer4\sheets\UR-Logs.xsl).
  • (Пере)запустить чаммер, открыть файл персонажа и нажать кнопку Print. Выбрать новый чаршит, выделить и скопировать сгенерированный текст (хоткеи могут не работать, используйте контекстное меню), вставить текст на урлоговики (сюда).
  • Образец вывода: Viktoria Novak
    Viktoria X. Novak (VXN, Vixen)
    SURGE'd Elf Lone Star Detective
    BODAGIREASTRCHAINTLOGWILEDG
    16(3)5(8)175511

    Magic: 5
    Essence: 6
    Initiative / IP: 10(13) / 1(4)
    Matrix Initiative / IP: 8 / 2
    Astral Initiative / IP: 10 / 3
    Lift / Carry: 15kg / 10kg
    Movement: walk 15/37, swim 6
    Armor: ballistic 7, impact 5
    Condition Tracks: physical 9, stun 9
    Active Skills: Assensing 6, Con 4, Dodge 4, Etiquette 4, Leadership 4, Longarms 1, Negotiation 4, Perception 4, Pilot Ground Craft 1, Pistols 4
    Knowledge Skills: Area Knowledge: Seattle 4, Bars and Clubs 1, English N, Law Enforcement 6, Magical Theory 4, Magical Threats 4, News 2, Sperethiel 4, Street Racing 1, Underworld 4
    Qualities: Adept, Broad Auditory System (Ultrasound), Celerity, Changeling (Class III SURGE), Day Job (40 hrs/week), Distinctive Style, Extravagant Eyes, Geas (Combat Sense, Nature Affinity), Geas (Improved Reflexes, Nature Affinity), Glamour, Low-Light Vision, Nano Intolerance, Prejudiced (Specific, Biased) (Humanis Policlub), Records on File (Lone Star), SINner (Standard) (Viktoria X. Novak, UCAS), The Warrior's Way, Unusual Hair, Vestigial Tail, Vomeronasal Organ
    Powers: Astral Perception, Combat Sense 3, Commanding Voice, Eidetic Sense Memory, Improved Reflexes 3, Magic Sense
    .
  • В чаммере можно в опциях на вкладке Global выбрать сохранённый файл дефолтным чаршитом.
  • Необязательно, но там же в опциях на вкладке Character and Printing можно включить печать всех навыков, бухгалтерии кармы/нюен и заметок (после изменения настроек печати необходим перезапуск чаммера).
  • Рекомендуется заполнить поля на вкладке Character Info (в редакторе персонажа, не опциях).
  • Дополнительную информацию можно записывать в поле Notes самого персонажа (в Character Info). Поддерживаются категории, цитаты и комментарии к отдельным скиллам, остальное игнорируется:
  Some text to be ignored or something. You can write anything here and everywhere - only text in double brackets is looked for:
  [[Category:Seattle Investigators Xtravaganza]] - text in square brackets will be used as header;
  {{Q|Why is it that every time I think I know the answers, someone goes and changes the questions?|Special Agent Fox Mulder|||nolink=1}} - quotes will be printed too;
  ((Perception|+3 smell, hearing, vision)) - and that's how you write down comments to be used with skills.
  • Work in progress, comments requested.

Code

<?xml version="1.0" encoding="UTF-8" ?>
<!-- UR SR4 Character Sheet -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/characters/character">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      </head>
      <body style="font-family:courier new,courier; font-size: 9pt;">

        <xsl:call-template name="include.sidemenu"/>

        <xsl:call-template name="include.summary"/>

        <xsl:call-template name="include.headers"/>

        <xsl:call-template name="include.quotes"/>

        <xsl:call-template name="section.character"/>

        <xsl:call-template name="section.description"/>

        <xsl:call-template name="section.background"/>

        <xsl:call-template name="section.actionskills"/>

        <xsl:call-template name="section.knowledgeskills"/>

<!--    Uncomment here and further down to separate languages from knowledge skills
        <xsl:call-template name="section.languageskills"/>  -->

        <xsl:call-template name="section.attacks"/>

        <xsl:call-template name="section.qualities"/>

        <xsl:call-template name="section.powers"/>

        <xsl:call-template name="section.martialarts"/>

        <xsl:call-template name="section.complexforms"/>

        <xsl:call-template name="section.spells"/>

        <xsl:call-template name="section.spirites"/>

        <xsl:call-template name="section.vehicles"/>

        <xsl:call-template name="section.lifestyles"/>

        <xsl:call-template name="section.contacts"/>

        <xsl:call-template name="section.sins"/>

        <xsl:call-template name="section.commlinks"/>

        <xsl:call-template name="section.weapons"/>

        <xsl:call-template name="section.armor"/>

        <xsl:call-template name="section.gear"/>

<!--    Uncomment this and comment out weapons/armor/gear up there and in sidemenu to replace separate equipment list with joint one 
        <xsl:call-template name="section.equipment"/>  -->

        <xsl:call-template name="section.augmentations"/>

        <xsl:call-template name="section.nuyen"/>

        <xsl:call-template name="section.karma"/>
      </body>
    </html>
  </xsl:template>

  <xsl:template name="include.headers">
    [[Category:Characters]]<br/>
    <xsl:if test="contains(notes, '[[') and contains(notes, ']]')">
      <xsl:call-template name="text.headers">
        <xsl:with-param name="text">
          <xsl:value-of select="notes"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name="include.summary">
    {{Sidebar|Name=&lt;onlyinclude&gt;{{SR4_Statblock<br/>
    &#160; |Name=<xsl:value-of select="name"/><xsl:if test="alias != ''"> (<xsl:value-of select="alias"/>)</xsl:if><br/>
    &#160; |Detail=
    <xsl:choose>
      <xsl:when test="concept != ''"><xsl:value-of select="concept"/></xsl:when>
      <xsl:otherwise>
        <xsl:if test="sex != ''"><xsl:value-of select="sex"/>&#160;</xsl:if>
        <xsl:if test="qualities/quality[contains(name,'Infected')]"><xsl:value-of select="substring-after(qualities/quality[contains(name,'Infected')]/name,' ')"/>&#160;</xsl:if>
        <xsl:if test="qualities/quality[name = 'Drake']">Drake&#160;</xsl:if>
        <xsl:if test="qualities/quality[contains(name,'Changeling')]">Changeling&#160;</xsl:if>
        <xsl:choose>
         <xsl:when test="metavariant != ''"><xsl:value-of select="metavariant"/>&#160;</xsl:when>
         <xsl:otherwise><xsl:value-of select="metatype"/>&#160;</xsl:otherwise>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="adept = 'True' and magician = 'True'">Mystic</xsl:when>
          <xsl:when test="adept = 'True'">Adept</xsl:when>
          <xsl:when test="magician = 'True'">Mage</xsl:when>
          <xsl:when test="technomancer = 'True'">Technomancer</xsl:when>
          <xsl:when test="cyberwares/cyberware[name = 'Control Rig']">Rigger</xsl:when>
          <xsl:otherwise>Shadowrunner</xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose><br/>
    &#160; |BOD=<xsl:value-of select="attributes/attribute[name = 'BOD']/base"/>
    <xsl:if test="attributes/attribute[name = 'BOD']/total != attributes/attribute[name = 'BOD']/base">(<xsl:value-of select="attributes/attribute[name = 'BOD']/total"/>)</xsl:if><br/>
    &#160; |AGI=<xsl:value-of select="attributes/attribute[name = 'AGI']/base"/>
    <xsl:if test="attributes/attribute[name = 'AGI']/total != attributes/attribute[name = 'AGI']/base">(<xsl:value-of select="attributes/attribute[name = 'AGI']/total"/>)</xsl:if><br/>
    &#160; |REA=<xsl:value-of select="attributes/attribute[name = 'REA']/base"/>
    <xsl:if test="attributes/attribute[name = 'REA']/total != attributes/attribute[name = 'REA']/base">(<xsl:value-of select="attributes/attribute[name = 'REA']/total"/>)</xsl:if><br/>
    &#160; |STR=<xsl:value-of select="attributes/attribute[name = 'STR']/base"/>
    <xsl:if test="attributes/attribute[name = 'STR']/total != attributes/attribute[name = 'STR']/base">(<xsl:value-of select="attributes/attribute[name = 'STR']/total"/>)</xsl:if><br/>
    &#160; |CHA=<xsl:value-of select="attributes/attribute[name = 'CHA']/base"/>
    <xsl:if test="attributes/attribute[name = 'CHA']/total != attributes/attribute[name = 'CHA']/base">(<xsl:value-of select="attributes/attribute[name = 'CHA']/total"/>)</xsl:if><br/>
    &#160; |INT=<xsl:value-of select="attributes/attribute[name = 'INT']/base"/>
    <xsl:if test="attributes/attribute[name = 'INT']/total != attributes/attribute[name = 'INT']/base">(<xsl:value-of select="attributes/attribute[name = 'INT']/total"/>)</xsl:if><br/>
    &#160; |LOG=<xsl:value-of select="attributes/attribute[name = 'LOG']/base"/>
    <xsl:if test="attributes/attribute[name = 'LOG']/total != attributes/attribute[name = 'LOG']/base">(<xsl:value-of select="attributes/attribute[name = 'LOG']/total"/>)</xsl:if><br/>
    &#160; |WIL=<xsl:value-of select="attributes/attribute[name = 'WIL']/base"/>
    <xsl:if test="attributes/attribute[name = 'WIL']/total != attributes/attribute[name = 'WIL']/base">(<xsl:value-of select="attributes/attribute[name = 'WIL']/total"/>)</xsl:if><br/>
    &#160; |EDG=<xsl:value-of select="attributes/attribute[name = 'EDG']/base"/>
    <xsl:if test="attributes/attribute[name = 'EDG']/total != attributes/attribute[name = 'EDG']/base">(<xsl:value-of select="attributes/attribute[name = 'EDG']/total"/>)</xsl:if><br/>
    <xsl:if test="magenabled = 'True'">
      &#160; |MAG=<xsl:value-of select="attributes/attribute[name = 'MAG']/base"/>
      <xsl:if test="attributes/attribute[name = 'MAG']/total != attributes/attribute[name = 'MAG']/base">(<xsl:value-of select="attributes/attribute[name = 'MAG']/total"/>)</xsl:if><br/>
    </xsl:if>
    <xsl:if test="resenabled = 'True'">
      &#160; |RES=<xsl:value-of select="attributes/attribute[name = 'RES']/base"/>
      <xsl:if test="attributes/attribute[name = 'RES']/total != attributes/attribute[name = 'RES']/base">(<xsl:value-of select="attributes/attribute[name = 'RES']/total"/>)</xsl:if><br/>
    </xsl:if>
    &#160; |Ess=<xsl:value-of select="attributes/attribute[name = 'ESS']/base"/><br/>
    &#160; |Init=<xsl:value-of select="init/base"/>
    <xsl:if test="init/total != init/base">(<xsl:value-of select="init/total"/>)</xsl:if>
    / <xsl:value-of select="ip/base"/>
    <xsl:if test="ip/total != ip/base">(<xsl:value-of select="ip/total"/>)</xsl:if><br/>
    <xsl:if test="matrixip/base">&#160; |MInit=<xsl:value-of select="matrixinit/base"/> / <xsl:value-of select="matrixip/base"/><br/></xsl:if>
    <xsl:if test="astralip/base">&#160; |AInit=<xsl:value-of select="astralinit/base"/> / <xsl:value-of select="astralip/base"/><br/></xsl:if>
    <xsl:if test="memory != attributes/attribute[name = 'LOG']/total + attributes/attribute[name = 'WIL']/total">&#160; |Memory=<xsl:value-of select="memory"/><br/></xsl:if>
    <xsl:if test="composure != attributes/attribute[name = 'WIL']/total + attributes/attribute[name = 'CHA']/total">&#160; |Composure=walk <xsl:value-of select="composure"/><br/></xsl:if>
    <xsl:if test="judgeintentions != attributes/attribute[name = 'INT']/total + attributes/attribute[name = 'CHA']/total">&#160; |Judge=walk <xsl:value-of select="judgeintentions"/><br/></xsl:if>
    &#160; |LiftCarry=<xsl:value-of select="liftweight"/>kg / <xsl:value-of select="carryweight"/>kg<br/>
    &#160; |Movement=walk <xsl:value-of select="movementwalk"/>
    <xsl:if test="movementswim != 0">, swim <xsl:value-of select="movementswim"/></xsl:if>
    <xsl:if test="movementfly != 0">,fly <xsl:value-of select="movementfly"/></xsl:if><br/>
    &#160; |Armor=ballistic <xsl:value-of select="armorb"/>, impact <xsl:value-of select="armori"/><br/>
    &#160; |CTracks=physical <xsl:value-of select="physicalcm"/>, stun <xsl:value-of select="stuncm"/><br/>
    <xsl:variable name="skills" select="skills/skill[knowledge = 'False' and rating &gt; 0]"/>
    <xsl:if test="$skills">&#160; |ASkills=
      <xsl:for-each select="$skills">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:call-template name="text.list"/>
      </xsl:for-each><br/>
    </xsl:if>
    <xsl:variable name="knowledges" select="skills/skill[knowledge = 'True']"/>
    <xsl:if test="$knowledges">&#160; |KSkills=
      <xsl:for-each select="$knowledges">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:call-template name="text.list"/>
      </xsl:for-each><br/>
    </xsl:if>
    <xsl:variable name="qualities" select="qualities/quality | critterpowers/critterpower[category = 'Weakness']"/>
    <xsl:if test="$qualities">&#160; |Qualities=
      <xsl:for-each select="$qualities">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:value-of select="name"/>
        <xsl:if test="(name = 'Magician' or name = 'Mystic Adept') and ../../tradition != ''">&#160;(<xsl:value-of select="../../tradition"/>)</xsl:if>
        <xsl:if test="name = 'Technomancer' and not(../../stream = '' or ../../stream = 'Default')">&#160;(<xsl:value-of select="../../stream"/>)</xsl:if>
        <xsl:if test="extra != ''"> (<xsl:value-of select="extra"/>)</xsl:if>
        <xsl:if test="position() != last()">, </xsl:if>
      </xsl:for-each><br/>
    </xsl:if>
    <xsl:variable name="powers" select="powers/power | critterpowers/critterpower[category != 'Weakness']"/>
    <xsl:if test="$powers">&#160; |Powers=
      <xsl:for-each select="$powers">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:call-template name="text.list"/>
      </xsl:for-each><br/>
    </xsl:if>
    <xsl:if test="spells/spell">&#160; |Spells=
      <xsl:for-each select="spells/spell">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:call-template name="text.list"/>
      </xsl:for-each><br/>
    </xsl:if>
    <xsl:if test="techprograms/techprogram">&#160; |CForms=
      <xsl:for-each select="techprograms/techprogram">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:call-template name="text.list"/>
      </xsl:for-each><br/>
    </xsl:if>
    <xsl:if test="martialarts/martialart">&#160; |MArts=
      <xsl:for-each select="martialarts/martialart">
        <xsl:sort select="name"/>
        <xsl:call-template name="text.list"/>
      </xsl:for-each>
      <xsl:if test="martialartmaneuvers/martialartmaneuver">,
        <xsl:for-each select="martialartmaneuvers/martialartmaneuver">
          <xsl:sort select="name"/>
          <xsl:call-template name="text.list"/>
        </xsl:for-each>
      </xsl:if><br/>
    </xsl:if>
    &#160; |Border=0<br/>
    }}&lt;/onlyinclude&gt;}}<br/><br/>
  </xsl:template>

  <xsl:template name="include.quotes">
    <xsl:if test="contains(notes, '{{Q|') and contains(notes, '}}')">
      <xsl:call-template name="text.quotes">
        <xsl:with-param name="text">
          <xsl:value-of select="notes"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name="include.sidemenu">
    {{FloatTOC|Character
    <xsl:if test="description != ''">|Description</xsl:if>
    <xsl:if test="background != ''">|Background</xsl:if>
    <xsl:if test="skills/skill[knowledge = 'False']">|Active Skills</xsl:if>
    <xsl:if test="skills/skill[knowledge = 'True']">|Knowledge Skills</xsl:if>
<!--<xsl:if test="skills/skill[knowledge = 'True' and islanguage = 'False']">|Knowledge Skills</xsl:if>
    <xsl:if test="skills/skill[knowledge = 'True' and islanguage = 'True']">|Languages</xsl:if>  -->
    <xsl:if test="//*/weapon">|Attacks</xsl:if>
    <xsl:if test="qualities/quality | critterpowers/critterpower[category = 'Weakness']">|Qualities</xsl:if>
    <xsl:if test="powers/power | critterpowers/critterpower[category != 'Weakness']">|Powers</xsl:if>
    <xsl:if test="martialarts/martialart">|Martial Arts</xsl:if>
    <xsl:if test="techprograms/techprogram">|Complex Forms</xsl:if>
    <xsl:if test="spells/spell">|Spells</xsl:if>
    <xsl:if test="spirits/spirit">
      <xsl:choose>
        <xsl:when test="technomancer = 'True'">|Sprites</xsl:when>
        <xsl:otherwise>|Spirits</xsl:otherwise>
      </xsl:choose>
    </xsl:if>
    <xsl:if test="vehicles/vehicle">|Vehicles and Drones</xsl:if>
    <xsl:if test="lifestyles/lifestyle">|Lifestyles</xsl:if>
    <xsl:if test="contacts/contact">|Contacts</xsl:if>
    <xsl:if test="//*[issin = 'True' or contains(name, 'SIN,')]">|SINs</xsl:if>
    <xsl:if test="//*[iscommlink = 'True' or isnexus = 'True']">|Commlinks</xsl:if>
    <xsl:if test="weapons/weapon">|Weapons</xsl:if>
    <xsl:if test="armors/armor">|Armor</xsl:if>
    <xsl:if test="gears/gear[iscommlink != 'True' or isnexus != 'True']">|Gear</xsl:if>
<!--<xsl:if test="armors/armor | weapons/weapon[name != 'Unarmed Attack'] | gears/gear[not(contains(name, 'renade:'))]">|Equipment</xsl:if>  -->
    <xsl:if test="cyberwares/cyberware">|Augmentations</xsl:if>
    <xsl:if test="expenses/expense[type = 'Nuyen']">|Nuyen Expenses</xsl:if>
    <xsl:if test="expenses/expense[type = 'Karma']">|Karma Expenses</xsl:if>
    }}<br/>
  </xsl:template>

  <xsl:template name="section.description">
    <xsl:if test="description != ''">
      == Description ==<br/>
      &lt;p align="justify"&gt;
      <xsl:call-template name="text.multiline">
        <xsl:with-param name="text" select="description"/>
      </xsl:call-template>
      &lt;/p&gt;
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.background">
    <xsl:if test="background != ''">
      == Background ==<br/>
      &lt;p align="justify"&gt;
      <xsl:call-template name="text.multiline">
        <xsl:with-param name="text" select="background"/>
      </xsl:call-template>
      &lt;/p&gt;
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.character">
    == Character ==<br/>
    &lt;div style="display:flex; flex-flow:row wrap;"&gt;
    &lt;div style="font-family:monospace; font-size:medium; padding-right:100px;"&gt;<br/>
    &lt;b&gt;Name:&lt;/b&gt; <xsl:value-of select="name"/>&lt;br/&gt;<br/>
    &lt;b&gt;Alias(es):&lt;/b&gt; <xsl:value-of select="alias"/>&lt;br/&gt;<br/>
    &lt;b&gt;Metatype:&lt;/b&gt; <xsl:value-of select="metatype"/>
    <xsl:if test="metavariant != '' or qualities/quality[name = 'Drake'] or qualities/quality[contains(name,'Changeling')] or qualities/quality[contains(name,'Infected')]">
      (<xsl:if test="qualities/quality[contains(name,'Infected')]"><xsl:value-of select="substring-after(qualities/quality[contains(name,'Infected')]/name,' ')"/><xsl:if test="qualities/quality[contains(name,'Changeling')] or metavariant != ''">&#160;</xsl:if></xsl:if>
      <xsl:if test="qualities/quality[name = 'Drake']">Drake<xsl:if test="qualities/quality[contains(name,'Changeling')] or metavariant != ''">&#160;</xsl:if></xsl:if>
      <xsl:if test="qualities/quality[contains(name,'Changeling')]">Changeling<xsl:if test="metavariant != ''">&#160;</xsl:if></xsl:if>
      <xsl:if test="metavariant != ''"><xsl:value-of select="metavariant"/></xsl:if>)
    </xsl:if>&lt;br/&gt;<br/>
    <xsl:if test="sex != ''">&lt;b&gt;Sex:&lt;/b&gt; <xsl:value-of select="sex"/>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="age != ''"><xsl:choose>
      <xsl:when test="number(age) = age">&lt;b&gt;Age:&lt;/b&gt; <xsl:value-of select="age"/></xsl:when>
      <xsl:otherwise>&lt;b&gt;Date of Birth:&lt;/b&gt; <xsl:value-of select="age"/></xsl:otherwise>
    </xsl:choose>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="height != ''">&lt;b&gt;Height:&lt;/b&gt; <xsl:value-of select="height"/>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="weight != ''">&lt;b&gt;Weight:&lt;/b&gt; <xsl:value-of select="weight"/>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="skin != ''">&lt;b&gt;Skin:&lt;/b&gt; <xsl:value-of select="skin"/>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="hair != ''">&lt;b&gt;Hair:&lt;/b&gt; <xsl:value-of select="hair"/>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="eyes != ''">&lt;b&gt;Eyes:&lt;/b&gt; <xsl:value-of select="eyes"/>&lt;br/&gt;<br/></xsl:if>
    &lt;br/&gt;<br/>
    &lt;b&gt;Street Cred:&lt;/b&gt; <xsl:value-of select="totalstreetcred"/>&lt;br/&gt;<br/>
    &lt;b&gt;Notoriety:&lt;/b&gt; <xsl:value-of select="totalnotoriety"/>&lt;br/&gt;<br/>
    &lt;b&gt;Public Awareness:&lt;/b&gt; <xsl:value-of select="totalpublicawareness"/>&lt;br/&gt;<br/>
    &lt;b&gt;Karma:&lt;/b&gt; <xsl:value-of select="karma"/> / <xsl:value-of select="totalkarma"/>&lt;br/&gt;<br/>
    &lt;b&gt;Nuyen:&lt;/b&gt; <xsl:value-of select="nuyen"/><br/>
    &lt;/div&gt;&lt;div style="font-family:monospace; font-size:medium; padding-right:100px;"&gt;<br/>
    &lt;b&gt;BOD:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'BOD']/base"/>
    <xsl:if test="attributes/attribute[name = 'BOD']/total != attributes/attribute[name = 'BOD']/base">(<xsl:value-of select="attributes/attribute[name = 'BOD']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;AGI:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'AGI']/base"/>
    <xsl:if test="attributes/attribute[name = 'AGI']/total != attributes/attribute[name = 'AGI']/base">(<xsl:value-of select="attributes/attribute[name = 'AGI']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;REA:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'REA']/base"/>
    <xsl:if test="attributes/attribute[name = 'REA']/total != attributes/attribute[name = 'REA']/base">(<xsl:value-of select="attributes/attribute[name = 'REA']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;STR:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'STR']/base"/>
    <xsl:if test="attributes/attribute[name = 'STR']/total != attributes/attribute[name = 'STR']/base">(<xsl:value-of select="attributes/attribute[name = 'STR']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;CHA:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'CHA']/base"/>
    <xsl:if test="attributes/attribute[name = 'CHA']/total != attributes/attribute[name = 'CHA']/base">(<xsl:value-of select="attributes/attribute[name = 'CHA']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;INT:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'INT']/base"/>
    <xsl:if test="attributes/attribute[name = 'INT']/total != attributes/attribute[name = 'INT']/base">(<xsl:value-of select="attributes/attribute[name = 'INT']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;LOG:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'LOG']/base"/>
    <xsl:if test="attributes/attribute[name = 'LOG']/total != attributes/attribute[name = 'LOG']/base">(<xsl:value-of select="attributes/attribute[name = 'LOG']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;WIL:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'WIL']/base"/>
    <xsl:if test="attributes/attribute[name = 'WIL']/total != attributes/attribute[name = 'WIL']/base">(<xsl:value-of select="attributes/attribute[name = 'WIL']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;EDG:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'EDG']/base"/>
    <xsl:if test="attributes/attribute[name = 'EDG']/total != attributes/attribute[name = 'EDG']/base">(<xsl:value-of select="attributes/attribute[name = 'EDG']/total"/>)
    </xsl:if>&lt;br/&gt;<br/>
    <xsl:if test="magenabled = 'True'">
      &lt;b&gt;MAG:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'MAG']/base"/>
      <xsl:if test="attributes/attribute[name = 'MAG']/total != attributes/attribute[name = 'MAG']/base">(<xsl:value-of select="attributes/attribute[name = 'MAG']/total"/>)
      </xsl:if>&lt;br/&gt;<br/>
    </xsl:if>
    <xsl:if test="resenabled = 'True'">
      &lt;b&gt;RES:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'RES']/base"/>
      <xsl:if test="attributes/attribute[name = 'RES']/total != attributes/attribute[name = 'RES']/base">(<xsl:value-of select="attributes/attribute[name = 'RES']/total"/>)
      </xsl:if>&lt;br/&gt;<br/>
    </xsl:if>
    &lt;/div&gt;&lt;div style="font-family:monospace; font-size:medium;"&gt;<br/>
    &lt;b&gt;Essence:&lt;/b&gt; <xsl:value-of select="attributes/attribute[name = 'ESS']/base"/>&lt;br/&gt;<br/>
    &lt;b&gt;Initiative / IPasses:&lt;/b&gt; <xsl:value-of select="init/base"/>
    <xsl:if test="init/total != init/base">(<xsl:value-of select="init/total"/>)</xsl:if>
    / <xsl:value-of select="ip/base"/>
    <xsl:if test="ip/total != ip/base">(<xsl:value-of select="ip/total"/>)</xsl:if>&lt;br/&gt;<br/>
    <xsl:if test="astralip/base">
      &lt;b&gt;Astral Initiative / IPasses:&lt;/b&gt; <xsl:value-of select="astralinit/base"/> / <xsl:value-of select="astralip/base"/>&lt;br/&gt;<br/>
    </xsl:if>
    <xsl:if test="matrixip/base">
      &lt;b&gt;Matrix Initiative / IPasses:&lt;/b&gt; <xsl:value-of select="matrixinit/base"/> / <xsl:value-of select="matrixip/base"/>&lt;br/&gt;<br/>
    </xsl:if>
    <xsl:if test="magician = 'True'">&lt;b&gt;Resist Drain:&lt;/b&gt; <xsl:value-of select="drain"/>&lt;br/&gt;<br/></xsl:if>
    <xsl:if test="technomancer = 'True'">&lt;b&gt;Resist Fading:&lt;/b&gt;
      <xsl:choose>
        <xsl:when test="drain[2]"><xsl:value-of select="drain[2]"/></xsl:when>
        <xsl:otherwise><xsl:value-of select="drain"/></xsl:otherwise>
      </xsl:choose>
      &lt;br/&gt;<br/>
    </xsl:if>
    &lt;b&gt;Memory:&lt;/b&gt; <xsl:value-of select="memory"/>&lt;br/&gt;<br/>
    &lt;b&gt;Composure:&lt;/b&gt; <xsl:value-of select="composure"/>&lt;br/&gt;<br/>
    &lt;b&gt;Judge Intentions:&lt;/b&gt; <xsl:value-of select="judgeintentions"/>&lt;br/&gt;<br/>
    &lt;b&gt;Lift and Carry:&lt;/b&gt; <xsl:value-of select="liftandcarry"/>
    (<xsl:value-of select="liftweight"/>kg / <xsl:value-of select="carryweight"/>kg)&lt;br/&gt;<br/>
    &lt;b&gt;Movement:&lt;/b&gt; walk <xsl:value-of select="movementwalk"/>
    <xsl:if test="movementswim != 0">, swim <xsl:value-of select="movementswim"/></xsl:if>
    <xsl:if test="movementfly != 0">,fly <xsl:value-of select="movementfly"/></xsl:if>&lt;br/&gt;<br/>
    &lt;b&gt;Armor:&lt;/b&gt; ballistic <xsl:value-of select="armorb"/>, impact <xsl:value-of select="armori"/>&lt;br/&gt;<br/>
    &lt;b&gt;Physical Condition Track:&lt;/b&gt; <xsl:value-of select="physicalcmfilled"/> / <xsl:value-of select="physicalcm"/>&lt;br/&gt;<br/>
    &lt;b&gt;Stun Condition Track:&lt;/b&gt; <xsl:value-of select="stuncmfilled"/> / <xsl:value-of select="stuncm"/><br/>
    &lt;/div&gt;&lt;/div&gt;&lt;br/&gt;<br/><br/>
  </xsl:template>

  <xsl:template name="section.actionskills">
    <xsl:variable name="actions" select="skills/skill[knowledge = 'False']"/>
    <xsl:if test="$actions">
      == Active Skills ==<br/>
      {| class="hover zebra sortable" style="width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! width="203px" | Skill<br/>
      &#160; ! width="53px" | ATTR<br/>
      &#160; ! width="53px" | Rtg<br/>
      &#160; ! width="53px" | Pool<br/>
      &#160; ! width="78px" | Math<br/>
      &#160; ! width="78px" | Category<br/>
      &#160; ! width="128px" | Group<br/>
      &#160; ! Notes<br/>
      <xsl:for-each select="$actions">
        &#160; |-<br/>
        &#160; | <xsl:value-of select="name"/><xsl:if test="spec != ''">&#160;[<xsl:value-of select="spec"/>]</xsl:if><br/>
        &#160; | style="text-align:center;" | <xsl:value-of select="attribute"/><br/>
        &#160; | style="text-align:center;" | <xsl:if test="rating &gt; 0"><xsl:value-of select="rating"/></xsl:if><br/>
        &#160; | style="text-align:right;" | '''<xsl:value-of select="total"/>'''
        || (<xsl:value-of select="attributemod"/>
        <xsl:choose>
          <xsl:when test="rating = 0">-1</xsl:when>
          <xsl:otherwise>+<xsl:value-of select="rating"/></xsl:otherwise>
        </xsl:choose>
        <xsl:if test="ratingmod &gt; 0">+<xsl:value-of select="ratingmod"/></xsl:if>
        <xsl:if test="ratingmod &lt; 0"><xsl:value-of select="ratingmod"/></xsl:if>
        <xsl:if test="poolmod &gt; 0">+<xsl:value-of select="poolmod"/></xsl:if>
        <xsl:if test="poolmod &lt; 0"><xsl:value-of select="poolmod"/></xsl:if>)
        || <xsl:value-of select="substring-before(skillcategory,' ')"/>
        || <xsl:value-of select="skillgroup"/>
        || <xsl:if test="contains(/characters/character/notes, concat('((', name, '|')) and contains(/characters/character/notes, '))')"><xsl:value-of select="substring-before(substring-after(/characters/character/notes, concat('((', name, '|')), '))')"/></xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.knowledgeskills">
    <xsl:variable name="knowledges" select="skills/skill[knowledge = 'True']"/>
<!--<xsl:variable name="knowledges" select="skills/skill[knowledge = 'True' and islanguage = 'False']"/>  -->
    <xsl:if test="$knowledges">
      == Knowledge Skills ==<br/>
      {| class="hover zebra sortable" style="width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! width="203px" | Skill<br/>
      &#160; ! width="53px" | ATTR<br/>
      &#160; ! width="53px" | Rtg<br/>
      &#160; ! width="53px" | Pool<br/>
      &#160; ! width="78px" | Math<br/>
      &#160; ! width="78px" | Category<br/>
      &#160; ! Notes<br/>
      <xsl:for-each select="$knowledges">
        &#160; |-<br/>
        &#160; | <xsl:value-of select="name"/><xsl:if test="spec != ''">&#160;[<xsl:value-of select="spec"/>]</xsl:if><br/>
        &#160; | style="text-align:center;" | <xsl:value-of select="attribute"/><br/>
        &#160; | style="text-align:center;" | <xsl:value-of select="rating"/><br/>
        &#160; | style="text-align:right;" | '''<xsl:value-of select="total"/>'''
        || (<xsl:value-of select="attributemod"/>+<xsl:value-of select="rating"/>
        <xsl:if test="ratingmod &gt; 0">+<xsl:value-of select="ratingmod"/></xsl:if>
        <xsl:if test="ratingmod &lt; 0"><xsl:value-of select="ratingmod"/></xsl:if>
        <xsl:if test="poolmod &gt; 0">+<xsl:value-of select="poolmod"/></xsl:if>
        <xsl:if test="poolmod &lt; 0"><xsl:value-of select="poolmod"/></xsl:if>)
        || <xsl:value-of select="skillcategory"/>
        || <xsl:if test="contains(/characters/character/notes, concat('((', name, '|')) and contains(/characters/character/notes, '))')"><xsl:value-of select="substring-before(substring-after(/characters/character/notes, concat('((', name, '|')), '))')"/></xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.languageskills">
    <xsl:variable name="items" select="skills/skill[knowledge = 'True' and islanguage = 'True']"/>
    <xsl:if test="$items">
      == Languages ==<br/>
      {| class="hover zebra sortable" style="width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! width="203px" | Skill<br/>
      &#160; ! width="53px" | ATTR<br/>
      &#160; ! width="53px" | Rtg<br/>
      &#160; ! width="53px" | Pool<br/>
      &#160; ! width="78px" | Math<br/>
      &#160; ! width="78px" | Category<br/>
      &#160; ! Notes<br/>
      <xsl:for-each select="$items">
        &#160; |-<br/>
        &#160; | <xsl:value-of select="name"/><xsl:if test="spec != ''">&#160;[<xsl:value-of select="spec"/>]</xsl:if><br/>
        &#160; | style="text-align:center;" | <xsl:value-of select="attribute"/><br/>
        &#160; | style="text-align:center;" | 
        <xsl:choose>
          <xsl:when test="rating &gt; 0"><xsl:value-of select="rating"/><br/>&#160; | style="text-align:right;" | '''<xsl:value-of select="total"/>'''</xsl:when>
          <xsl:otherwise>N<br/>&#160; | style="text-align:right;" | '''N'''</xsl:otherwise>
        </xsl:choose>
        ||
        <xsl:if test="rating &gt; 0">(<xsl:value-of select="attributemod"/>
          <xsl:choose>
            <xsl:when test="rating = 0">-1</xsl:when>
            <xsl:otherwise>+<xsl:value-of select="rating"/></xsl:otherwise>
          </xsl:choose>
          <xsl:if test="ratingmod &gt; 0">+<xsl:value-of select="ratingmod"/></xsl:if>
          <xsl:if test="ratingmod &lt; 0"><xsl:value-of select="ratingmod"/></xsl:if>
          <xsl:if test="poolmod &gt; 0">+<xsl:value-of select="poolmod"/></xsl:if>
          <xsl:if test="poolmod &lt; 0"><xsl:value-of select="poolmod"/></xsl:if>)
        </xsl:if>
        || <xsl:value-of select="skillcategory"/>
        || <xsl:if test="contains(/characters/character/notes, concat('((', name, '|')) and contains(/characters/character/notes, '))')"><xsl:value-of select="substring-before(substring-after(/characters/character/notes, concat('((', name, '|')), '))')"/></xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.attacks">
    <xsl:variable name="items" select="//*/weapon"/>
    <xsl:if test="$items">
      == Attacks ==<br/>
      {| class="hover zebra sortable" style="width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! Name !! DMG !! AP !! Mode !! Type !! Range !! Pool !! Notes<br/>
      <xsl:for-each select="$items">
        <xsl:sort select="concat(weaponname, name)"/>
        <xsl:choose>
          <xsl:when test="contains(name, 'Grenade: ')">
            <xsl:if test="count(preceding-sibling::*[contains(name, 'Grenade: ')]) = 0">
              &#160; |-<br/>
              &#160; | style="vertical-align:top;" | Grenade
              <xsl:for-each select="$items[contains(name, 'Grenade: ')]">
                <xsl:sort select="name"/>
                <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
                  &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;<xsl:value-of select="substring-after(name, ': ')"/>
                  (<xsl:for-each select="/characters/character/gears/gear[name = current()/name]">
                    <xsl:sort select="location"/>
                    <xsl:choose>
                      <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
                      <xsl:otherwise>x<xsl:value-of select="qty"/></xsl:otherwise>
                    </xsl:choose>
                    <xsl:if test="position() != last()">, </xsl:if>
                  </xsl:for-each>)
                </xsl:if>
              </xsl:for-each><br/>
              &#160; | style="vertical-align:top;" |
              <xsl:for-each select="$items[contains(name, 'Grenade: ')]">
                <xsl:sort select="name"/>
                <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
                  &lt;br/&gt;<xsl:value-of select="rawdamage"/>
                </xsl:if>
              </xsl:for-each><br/>
              &#160; | style="vertical-align:top;" |
              <xsl:for-each select="$items[contains(name, 'Grenade: ')]">
                <xsl:sort select="name"/>
                <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
                  &lt;br/&gt;<xsl:value-of select="ap"/>
                </xsl:if>
              </xsl:for-each><br/>
              &#160; | style="vertical-align:top;" | -<br/>
              &#160; | style="vertical-align:top;" | <xsl:value-of select="type"/><br/>
              &#160; | style="vertical-align:top;" | Range <xsl:value-of select="ranges/short"/> / <xsl:value-of select="ranges/medium"/> / <xsl:value-of select="ranges/long"/> / <xsl:value-of select="ranges/extreme"/><br/>
              &#160; | style="vertical-align:top;" | <xsl:value-of select="dicepool"/> ||<br/>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise>
            &#160; |-<br/>
            &#160; | style="vertical-align:top;" |
            <xsl:choose>
              <xsl:when test="weaponname != ''"><xsl:value-of select="weaponname"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
            </xsl:choose>
            <xsl:variable name="ammo" select="/characters/character/gears/gear[contains(name, 'Ammo:') and extra = current()/category]"/>
            <xsl:if test="$ammo">
              <xsl:for-each select="$ammo">
                <xsl:sort select="name"/>
                <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
                  &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;<xsl:value-of select="substring-after(name, ': ')"/>
                  (<xsl:for-each select="$ammo[name = current()/name]">
                    <xsl:sort select="location"/>
                    <xsl:choose>
                      <xsl:when test="location != ''">{{Tooltip|Text=x<xsl:value-of select="qty"/>|Popup=<xsl:value-of select="location"/>}}</xsl:when>
                      <xsl:otherwise>x<xsl:value-of select="qty"/></xsl:otherwise>
                    </xsl:choose>
                    <xsl:if test="position() != last()">, </xsl:if>
                  </xsl:for-each>)
                </xsl:if>
              </xsl:for-each>
            </xsl:if><br/>
            &#160; | style="vertical-align:top;" | <xsl:value-of select="rawdamage"/>
            <xsl:if test="$ammo">
              <xsl:for-each select="$ammo">
                <xsl:sort select="name"/>
                <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
                  &lt;br/&gt;<xsl:value-of select="weaponbonusdamage"/>
                </xsl:if>
              </xsl:for-each>
            </xsl:if><br/>
            &#160; | style="vertical-align:top;" | <xsl:value-of select="ap"/>
            <xsl:if test="$ammo">
              <xsl:for-each select="$ammo">
                <xsl:sort select="name"/>
                <xsl:if test="count(preceding-sibling::*[name = current()/name]) = 0">
                  &lt;br/&gt;<xsl:value-of select="weaponbonusap"/>
                </xsl:if>
              </xsl:for-each>
            </xsl:if><br/>
            &#160; | style="vertical-align:top;" | <xsl:if test="mode != ''"><xsl:value-of select="mode"/></xsl:if><br/>
            &#160; | style="vertical-align:top;" | <xsl:value-of select="type"/><br/>
            &#160; | style="vertical-align:top;" |
            <xsl:choose>
              <xsl:when test="type = 'Melee'">Reach <xsl:value-of select="reach"/></xsl:when>
              <xsl:otherwise>Range <xsl:value-of select="ranges/short"/> / <xsl:value-of select="ranges/medium"/> / <xsl:value-of select="ranges/long"/> / <xsl:value-of select="ranges/extreme"/></xsl:otherwise>
            </xsl:choose><br/>
            &#160; | style="vertical-align:top;" |
            <xsl:choose>
              <xsl:when test="ancestor::*[local-name() = 'vehicle'] and /characters/character/skills/skill[name = 'Gunnery']/rating != 0"><xsl:value-of select="/characters/character/skills/skill[name = 'Gunnery']/rating + 1 + dicepool"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="dicepool"/></xsl:otherwise>
            </xsl:choose>
            ||<br/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.lifestyles">
    <xsl:if test="lifestyles/lifestyle">
      == Lifestyles ==<br/>
      <xsl:for-each select="lifestyles/lifestyle">
        <xsl:sort select="concat(lifestylename, name)"/>
        <xsl:text>;&lt;span id="</xsl:text>
        <xsl:choose>
          <xsl:when test="lifestylename != ''"><xsl:value-of select="lifestylename"/>"&gt;<xsl:value-of select="lifestylename"/></xsl:when>
          <xsl:otherwise><xsl:value-of select="name"/>"&gt;<xsl:value-of select="name"/></xsl:otherwise>
        </xsl:choose>
        <xsl:text>&lt;/span&gt;</xsl:text>
        &lt;span class="ref"&gt;
        (<xsl:choose>
          <xsl:when test="purchased = 'True'">permanent</xsl:when>
          <xsl:otherwise><xsl:value-of select="months"/> month<xsl:if test="months > 1">s</xsl:if></xsl:otherwise>
        </xsl:choose>)&lt;/span&gt;<br/>
        :<xsl:choose>
          <xsl:when test="not(type = 'Standard')"><xsl:value-of select="substring(comforts,1,3)"/>/<xsl:value-of select="substring(entertainment,1,3)"/>/<xsl:value-of select="substring(necessities,1,3)"/>/<xsl:value-of select="substring(neighborhood,1,3)"/>/<xsl:value-of select="substring(security,1,3)"/></xsl:when>
          <xsl:otherwise><xsl:value-of select="name"/><xsl:value-of select="name"/></xsl:otherwise>
        </xsl:choose>,
        base cost <xsl:value-of select="cost"/>/mo.
        <xsl:if test="qualities/quality">
          <xsl:for-each select="qualities/quality">
            <xsl:sort select="."/>
            <xsl:value-of select="normalize-space(.)"/>
            <xsl:choose>
              <xsl:when test="position() != last()">, </xsl:when>
              <xsl:otherwise>.</xsl:otherwise>
            </xsl:choose>
          </xsl:for-each><br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.sins">
    <xsl:if test="//*[issin = 'True' or contains(name, 'SIN,')]">
      == SINs ==<br/>
      <xsl:for-each select="//*[issin = 'True' or contains(name, 'SIN,')]">
        <xsl:sort select="extra"/>
        ;&lt;span id="sin!<xsl:value-of select="extra"/>"&gt;
        <xsl:value-of select="extra"/>
        &lt;/span&gt;
        &lt;span class="ref"&gt;
        (<xsl:choose>
          <xsl:when test="contains(name, ',')">
            <xsl:value-of select="normalize-space(substring-after(name, ','))"/>
            <xsl:if test="rating != 0">, Rating <xsl:value-of select="rating"/></xsl:if>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="name"/>
            <xsl:if test="rating != 0">, Rating <xsl:value-of select="rating"/></xsl:if>
          </xsl:otherwise>
        </xsl:choose>)
        &lt;/span&gt;<br/>
        <xsl:if test="children/gear[contains(name, 'License')]">
          :&lt;p align="justify"&gt; Licenses:
          <xsl:for-each select="children/gear[contains(name, 'License')]">
            <xsl:sort select="concat(gearname, name, extra)"/>
            <xsl:if test="qty &gt; 1"><xsl:value-of select="qty"/>x </xsl:if>
            <xsl:if test="notes != ''">{{Tooltip|Text=</xsl:if>
            <xsl:choose>
              <xsl:when test="extra != ''"><xsl:value-of select="extra"/></xsl:when>
              <xsl:when test="gearname != ''"><xsl:value-of select="gearname"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
            </xsl:choose>
            <xsl:if test="contains(name, 'Fake')"> (Fake, Rating <xsl:value-of select="rating"/>)</xsl:if>
            <xsl:if test="notes != ''">|Style=text-align:justify;|Popup=<xsl:value-of select="normalize-space(notes)"/>}}</xsl:if>
            <xsl:if test="children/gear">
              [<xsl:for-each select="children/gear">
                <xsl:sort select="concat(gearname, name)"/>
                <xsl:call-template name="text.children"/>
              </xsl:for-each>
              <xsl:text>]</xsl:text>
            </xsl:if>
            <xsl:if test="position() != last()">, </xsl:if>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[not(contains(name, 'License'))]">
          :&lt;p align="justify"&gt; Incl.:
          <xsl:for-each select="children/gear[not(contains(name, 'License'))]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.commlinks">
    <xsl:if test="//*[iscommlink = 'True' or isnexus = 'True']">
      == Commlinks ==<br/>
      <xsl:for-each select="//*[iscommlink = 'True' or isnexus = 'True']">
        <xsl:sort select="concat(gearname, name)"/>
        ;&lt;span id="comm!<xsl:value-of select="concat(gearname, name)"/>"&gt;
        <xsl:choose>
          <xsl:when test="gearname != ''"><xsl:value-of select="gearname"/></xsl:when>
          <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
        </xsl:choose>
        &lt;/span&gt;
        &lt;span class="ref"&gt;
        (<xsl:if test="gearname != ''"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        :&lt;p align="justify"&gt;
        <xsl:choose>
          <xsl:when test="isnexus = 'True'">Nexus:</xsl:when>
          <xsl:otherwise>Commlink:</xsl:otherwise>
        </xsl:choose>
        Response <xsl:value-of select="response"/>,
        Signal <xsl:value-of select="signal"/>,
        System <xsl:value-of select="system"/>,
        Firewall <xsl:value-of select="firewall"/>.
        &lt;/p&gt;<br/>
        <xsl:if test="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft')) and equipped = 'True']">
          :&lt;p align="justify"&gt; Running Software:
          <xsl:for-each select="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft')) and equipped = 'True']">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft')) and equipped = 'False']">
          :&lt;p align="justify"&gt; Stored Software:
          <xsl:for-each select="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft')) and equipped = 'False']">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[issin = 'True' or contains(name, 'SIN,')]">
          :&lt;p align="justify"&gt; Linked SIN(s):
          <xsl:for-each select="children/gear[issin = 'True' or contains(name, 'SIN,')]">
            <xsl:sort select="concat(gearname, name, extra)"/>
            <xsl:choose>
              <xsl:when test="contains(name, ',')">
                <xsl:value-of select="substring-before(name, ',')"/> (<xsl:value-of select="normalize-space(substring-after(name, ','))"/>,
                <xsl:if test="rating != 0">Rating <xsl:value-of select="rating"/>,</xsl:if>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="name"/>
                <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>,</xsl:if>
              </xsl:otherwise>
            </xsl:choose>
            [[#sin!<xsl:value-of select="extra"/>|<xsl:value-of select="extra"/>]])
            <xsl:if test="children/gear">
              [<xsl:for-each select="children/gear">
                <xsl:sort select="concat(gearname, name)"/>
                <xsl:call-template name="text.children"/>
              </xsl:for-each>
              <xsl:text>]</xsl:text>
            </xsl:if>
            <xsl:if test="position() != last()">, </xsl:if>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[contains(category, 'Option')]">
          :&lt;p align="justify"&gt; Modifications:
          <xsl:for-each select="children/gear[contains(category, 'Option')]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[isos = 'False' and isprogram = 'False' and issin = 'False' and not(contains(name, 'SIN,')) and not(contains(category, 'Soft')) and not(contains(category, 'Option'))]">
          :&lt;p align="justify"&gt; Accessories:
          <xsl:for-each select="children/gear[isos = 'False' and isprogram = 'False' and issin = 'False' and not(contains(name, 'SIN,')) and not(contains(category, 'Soft')) and not(contains(category, 'Option'))]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.vehicles">
    <xsl:if test="vehicles/vehicle">
      == Vehicles and Drones ==<br/>
      <xsl:for-each select="vehicles/vehicle">
        <xsl:sort select="concat(vehiclename, name)"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;
        <xsl:choose>
          <xsl:when test="vehiclename != ''"><xsl:value-of select="vehiclename"/></xsl:when>
          <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
        </xsl:choose>
        &lt;/span&gt;
        &lt;span class="ref"&gt;
        (<xsl:if test="vehiclename != ''"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        :&lt;p align="justify"&gt;
        <xsl:choose>
          <xsl:when test="contains(name, '(')"><xsl:value-of select="substring-before(substring-after(name, '('), ')')"/>:</xsl:when>
          <xsl:when test="contains(category, 'Drones: ')"><xsl:value-of select="substring-after(category, ': ')"/> Drone:</xsl:when>
          <xsl:when test="substring(category, string-length(category)) = 's'"><xsl:value-of select="substring(category, 1, string-length(category) - 1)"/>:</xsl:when>
          <xsl:otherwise><xsl:value-of select="category"/>:</xsl:otherwise>
        </xsl:choose>
        Handling  <xsl:value-of select="handling"/>,
        Acceleration <xsl:value-of select="accel"/>,
        Speed <xsl:value-of select="speed"/>,
        Body <xsl:value-of select="body"/>,
        Armor <xsl:value-of select="armor"/>.&lt;/p&gt;<br/>
        :&lt;p align="justify"&gt; Dogbrain:
        Pilot <xsl:value-of select="pilot"/>,
        Device <xsl:value-of select="devicerating"/>,
        Response <xsl:value-of select="response"/>,
        System <xsl:value-of select="system"/>,
        Signal <xsl:value-of select="signal"/>,
        Firewall <xsl:value-of select="firewall"/>.&lt;/p&gt;<br/>
        :&lt;p align="justify"&gt; Sensor Array: Sensor <xsl:value-of select="sensor"/>, Signal <xsl:value-of select="sensorsignal"/>
        <xsl:if test="gears/gear[name = 'Vehicle Sensor']/children/gear">
          <xsl:text>, </xsl:text>
          <xsl:for-each select="gears/gear[name = 'Vehicle Sensor']/children/gear">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>
        </xsl:if>
        <xsl:text>.&lt;/p&gt;</xsl:text><br/>
        <xsl:if test="mods/mod">
          :&lt;p align="justify"&gt; Modifications:
          <xsl:for-each select="mods/mod">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="gears/gear[name != 'Vehicle Sensor']">
          :&lt;p align="justify"&gt; Add. Equipment:
          <xsl:for-each select="gears/gear[iscommlink != 'True' and name != 'Vehicle Sensor']">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.armor">
    <xsl:variable name="armor" select="armors/armor"/>
    <xsl:if test="$armor">
      == Armor ==<br/>
      {| class="hover sortable" style="border-collapse:collapse; border-spacing:0px; table-layout:fixed; width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! style="padding:0px;" | Name<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Category<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Location<br/>
      &#160; ! style="width:40px; padding:0px; text-align:left;" | Eq.<br/>
      <xsl:for-each select="$armor">
        <xsl:sort select="concat(armorname, name)"/>
        &#160; |-<br/>
        &#160; | style="max-width:0; overflow:visible; |
        &lt;div style="width:200%;"&gt;
        &lt;span id="<xsl:value-of select="concat(name, '!', armorname)"/>" style="font-weight:bold; font-style:normal;"&gt;
        <xsl:choose>
          <xsl:when test="armorname != ''"><xsl:value-of select="armorname"/></xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="name = 'Custom Placeholder'"><xsl:value-of select="extra"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="(extra != '') and (name != 'Custom Placeholder')"> (<xsl:value-of select="extra"/>)</xsl:if>
        <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
        <xsl:if test="qty &gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
        &lt;/span&gt;&lt;span class="ref"&gt;
        (<xsl:if test="(armorname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        :&lt;p align="justify"&gt;Armor:
        <xsl:choose>
          <xsl:when test="category = 'Helmets and Shields' or category = 'SecureTech PPP System'">
            +<xsl:value-of select="b"/> Ballistic, +<xsl:value-of select="i"/> Impact.
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="b"/> Ballistic, <xsl:value-of select="i"/> Impact,
            <xsl:variable name="limit">
              <xsl:choose>
                <xsl:when test="armormods/armormod[name = 'YNT SoftWeave']">
                  <xsl:value-of select="/characters/character/attributes/attribute[name = 'BOD']/total * 2 + /characters/character/attributes/attribute[name = 'STR']/total"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="/characters/character/attributes/attribute[name = 'BOD']/total * 2"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="b &lt; $limit">
                <xsl:choose>
                  <xsl:when test="i &lt; $limit"><xsl:value-of select="0"/></xsl:when>
                  <xsl:otherwise><xsl:value-of select="ceiling((i - $limit) div 2)"/></xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:otherwise>
                <xsl:choose>
                  <xsl:when test="i &lt; limit"><xsl:value-of select="ceiling((b - $limit) div 2)"/></xsl:when>
                  <xsl:otherwise><xsl:value-of select="ceiling((b - $limit) div 2) + ceiling((i - $limit) div 2)"/></xsl:otherwise>
                </xsl:choose>
              </xsl:otherwise>
            </xsl:choose>
            Encumbrance.
          </xsl:otherwise>
        </xsl:choose>
        &lt;/p&gt;<br/>
        <xsl:if test="armormods/armormod or gears/gear[contains(category, 'Enhancement')] or children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
          :&lt;p align="justify"&gt; Modifications:
          <xsl:for-each select="armormods/armormod | gears/gear[contains(category, 'Enhancement')] | children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="accessories/accessory">
          :&lt;p align="justify"&gt; Accessories:
          <xsl:for-each select="accessories/accessory">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="gears/gear[not(contains(category, 'Enhancement'))] or children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement'))]">
          :&lt;p align="justify"&gt; Incl.:
          <xsl:for-each select="gears/gear[not(contains(category, 'Enhancement'))] | children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement')) and not(contains(category, 'Soft')) and not(contains(name, 'SIN,')) and isprogram = 'False' and isos = 'False' and issin = 'False']">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
        &lt;/div&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;
        <xsl:value-of select="category"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;<xsl:value-of select="location"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" | <xsl:if test="equipped = 'True'">&lt;span style="font-weight:bold; font-style:normal;"&gt;✓&lt;/span&gt;</xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.weapons">
    <xsl:variable name="weapons" select="weapons/weapon[name != 'Unarmed Attack' and not(contains(category, 'Cyberware'))]"/>
    <xsl:if test="$weapons">
      == Weapons ==<br/>
      {| class="hover sortable" style="border-collapse:collapse; border-spacing:0px; table-layout:fixed; width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! style="padding:0px;" | Name<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Type<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Location<br/>
      &#160; ! style="width:40px; padding:0px; text-align:left;" | Eq.<br/>
      <xsl:for-each select="$weapons">
        <xsl:sort select="concat(weaponname, name)"/>
        &#160; |-<br/>
        &#160; | style="max-width:0; overflow:visible; |
        &lt;div style="width:200%;"&gt;
        &lt;span id="<xsl:value-of select="concat(name, '!', weaponname)"/>" style="font-weight:bold; font-style:normal;"&gt;
        <xsl:choose>
          <xsl:when test="weaponname != ''"><xsl:value-of select="weaponname"/></xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="name = 'Custom Placeholder'"><xsl:value-of select="extra"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="(extra != '') and (name != 'Custom Placeholder')"> (<xsl:value-of select="extra"/>)</xsl:if>
        <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
        <xsl:if test="qty &gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
        &lt;/span&gt;&lt;span class="ref"&gt;
        (<xsl:if test="(weaponname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        :&lt;p align="justify"&gt;<xsl:value-of select="type"/> Weapon:
        <xsl:choose>
          <xsl:when test="type = 'Melee'">Reach <xsl:value-of select="reach"/></xsl:when>
          <xsl:otherwise>Range <xsl:value-of select="ranges/short"/> / <xsl:value-of select="ranges/medium"/> / <xsl:value-of select="ranges/long"/> / <xsl:value-of select="ranges/extreme"/></xsl:otherwise>
        </xsl:choose>,
        Damage <xsl:value-of select="damage"/>, AP <xsl:value-of select="ap"/><xsl:if test="mode != ''">, Mode <xsl:value-of select="mode"/></xsl:if>.&lt;/p&gt;<br/>
        <xsl:if test="gears/gear[contains(category, 'Enhancement')] or mods/weaponmod or children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
          :&lt;p align="justify"&gt; Modifications:
          <xsl:for-each select="gears/gear[contains(category, 'Enhancement')] | mods/weaponmod | children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="accessories/accessory">
          :&lt;p align="justify"&gt; Accessories:
          <xsl:for-each select="accessories/accessory">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="underbarrel/weapon">
          :&lt;p align="justify"&gt; Add. Weapons:
          <xsl:for-each select="underbarrel/weapon">
            <xsl:sort select="concat(weaponname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="gears/gear[not(contains(category, 'Enhancement'))] or children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement'))]">
          :&lt;p align="justify"&gt; Incl.:
          <xsl:for-each select="gears/gear[not(contains(category, 'Enhancement'))] | children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement'))]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
        &lt;/div&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;
        <xsl:value-of select="category"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;<xsl:value-of select="location"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" | <xsl:if test="equipped = 'True'">&lt;span style="font-weight:bold; font-style:normal;"&gt;✓&lt;/span&gt;</xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.gear">
    <xsl:variable name="gear" select="gears/gear[not(contains(name, 'renade:')) and not(contains(name, 'SIN,')) and issin != 'True' and iscommlink != 'True']"/>
    <xsl:if test="$gear">
      == Gear ==<br/>
      {| class="hover sortable" style="border-collapse:collapse; border-spacing:0px; table-layout:fixed; width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! style="padding:0px;" | Name<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Type<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Location<br/>
      &#160; ! style="width:40px; padding:0px; text-align:left;" | Eq.<br/>
      <xsl:for-each select="$gear">
        <xsl:sort select="concat(gearname, name)"/>
        &#160; |-<br/>
        &#160; | style="max-width:0; overflow:visible; |
        &lt;div style="width:200%;"&gt;
        &lt;span id="<xsl:value-of select="concat(name, '!', gearname)"/>" style="font-weight:bold; font-style:normal;"&gt;
        <xsl:choose>
          <xsl:when test="gearname != ''"><xsl:value-of select="gearname"/></xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="name = 'Custom Placeholder'"><xsl:value-of select="extra"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="(extra != '') and (name != 'Custom Placeholder')"> (<xsl:value-of select="extra"/>)</xsl:if>
        <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
        <xsl:if test="qty &gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
        &lt;/span&gt;&lt;span class="ref"&gt;
        (<xsl:if test="(gearname != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        <xsl:if test="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft'))]">
          :&lt;p align="justify"&gt; Software:
          <xsl:for-each select="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft'))]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[issin = 'True' or contains(name, 'SIN,')]">
          :&lt;p align="justify"&gt; Linked SIN(s):
          <xsl:for-each select="children/gear[issin = 'True' or contains(name, 'SIN,')]">
            <xsl:sort select="concat(gearname, name, extra)"/>
            <xsl:choose>
              <xsl:when test="contains(name, ',')">
                <xsl:value-of select="substring-before(name, ',')"/> (<xsl:value-of select="normalize-space(substring-after(name, ','))"/>,
                <xsl:if test="rating != 0">Rating <xsl:value-of select="rating"/>,</xsl:if>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="name"/>
                <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>,</xsl:if>
              </xsl:otherwise>
            </xsl:choose>
            [[#sin!<xsl:value-of select="extra"/>|<xsl:value-of select="extra"/>]])
            <xsl:if test="children/gear">
              [<xsl:for-each select="children/gear">
                <xsl:sort select="concat(gearname, name)"/>
                <xsl:call-template name="text.children"/>
              </xsl:for-each>
              <xsl:text>]</xsl:text>
            </xsl:if>
            <xsl:if test="position() != last()">, </xsl:if>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="gears/gear[contains(category, 'Enhancement')] or children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
          :&lt;p align="justify"&gt; Modifications:
          <xsl:for-each select="gears/gear[contains(category, 'Enhancement')] | children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="accessories/accessory">
          :&lt;p align="justify"&gt; Accessories:
          <xsl:for-each select="accessories/accessory">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="gears/gear[not(contains(category, 'Enhancement'))] or children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement')) and not(contains(category, 'Soft')) and not(contains(name, 'SIN,')) and isprogram = 'False' and isos = 'False' and issin = 'False']">
          :&lt;p align="justify"&gt; Incl.:
          <xsl:for-each select="gears/gear[not(contains(category, 'Enhancement'))] | children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement')) and not(contains(category, 'Soft')) and not(contains(name, 'SIN,')) and isprogram = 'False' and isos = 'False' and issin = 'False']">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
        &lt;/div&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;
        <xsl:value-of select="category"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;<xsl:value-of select="location"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" | <xsl:if test="equipped = 'True'">&lt;span style="font-weight:bold; font-style:normal;"&gt;✓&lt;/span&gt;</xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.equipment">
    <xsl:variable name="gear" select="armors/armor | weapons/weapon[name != 'Unarmed Attack' and not(contains(category, 'Cyberware'))] | gears/gear[not(contains(name, 'renade:')) and not(contains(name, 'SIN,')) and issin != 'True' and iscommlink != 'True']"/>
    <xsl:if test="$gear">
      == Equipment ==<br/>
      {| class="hover sortable" style="border-collapse:collapse; border-spacing:0px; table-layout:fixed; width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! style="padding:0px;" | Name<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Type<br/>
      &#160; ! style="width:25%; padding:0px; text-align:left;" | Location<br/>
      &#160; ! style="width:40px; padding:0px; text-align:left;" | Eq.<br/>
      <xsl:for-each select="$gear">
        <xsl:sort select="concat(armorname, weaponname, gearname, name)"/>
        &#160; |-<br/>
        &#160; | style="max-width:0; overflow:visible; |
        &lt;div style="width:200%;"&gt;
        &lt;span id="<xsl:value-of select="concat(name, '!', armorname, weaponname, gearname)"/>" style="font-weight:bold; font-style:normal;"&gt;
        <xsl:choose>
          <xsl:when test="concat(armorname, weaponname, gearname) != ''"><xsl:value-of select="concat(armorname, weaponname, gearname)"/></xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="name = 'Custom Placeholder'"><xsl:value-of select="extra"/></xsl:when>
              <xsl:otherwise><xsl:value-of select="name"/></xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="(extra != '') and (name != 'Custom Placeholder')"> (<xsl:value-of select="extra"/>)</xsl:if>
        <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
        <xsl:if test="qty &gt; 1"> x<xsl:value-of select="qty"/></xsl:if>
        &lt;/span&gt;&lt;span class="ref"&gt;
        (<xsl:if test="(concat(armorname, weaponname, gearname) != '') or (name = 'Custom Placeholder')"><xsl:value-of select="name"/>, </xsl:if><xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        <xsl:choose>
          <xsl:when test="local-name() = 'armor'">
            :&lt;p align="justify"&gt;Armor:
            <xsl:choose>
              <xsl:when test="category = 'Helmets and Shields' or category = 'SecureTech PPP System'">
                +<xsl:value-of select="b"/> Ballistic, +<xsl:value-of select="i"/> Impact.
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="b"/> Ballistic, <xsl:value-of select="i"/> Impact,
                <xsl:variable name="limit">
                  <xsl:choose>
                    <xsl:when test="armormods/armormod[name = 'YNT SoftWeave']">
                      <xsl:value-of select="/characters/character/attributes/attribute[name = 'BOD']/total * 2 + /characters/character/attributes/attribute[name = 'STR']/total"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="/characters/character/attributes/attribute[name = 'BOD']/total * 2"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:variable>
                <xsl:choose>
                  <xsl:when test="b &lt; $limit">
                    <xsl:choose>
                      <xsl:when test="i &lt; $limit"><xsl:value-of select="0"/></xsl:when>
                      <xsl:otherwise><xsl:value-of select="ceiling((i - $limit) div 2)"/></xsl:otherwise>
                    </xsl:choose>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:choose>
                      <xsl:when test="i &lt; limit"><xsl:value-of select="ceiling((b - $limit) div 2)"/></xsl:when>
                      <xsl:otherwise><xsl:value-of select="ceiling((b - $limit) div 2) + ceiling((i - $limit) div 2)"/></xsl:otherwise>
                    </xsl:choose>
                  </xsl:otherwise>
                </xsl:choose>
                Encumbrance.
              </xsl:otherwise>
            </xsl:choose>
            &lt;/p&gt;<br/>
          </xsl:when>
          <xsl:when test="local-name() = 'weapon'">
            :&lt;p align="justify"&gt;<xsl:value-of select="type"/> Weapon:
            <xsl:choose>
              <xsl:when test="type = 'Melee'">Reach <xsl:value-of select="reach"/></xsl:when>
              <xsl:otherwise>Range <xsl:value-of select="ranges/short"/> / <xsl:value-of select="ranges/medium"/> / <xsl:value-of select="ranges/long"/> / <xsl:value-of select="ranges/extreme"/></xsl:otherwise>
            </xsl:choose>,
            Damage <xsl:value-of select="damage"/>, AP <xsl:value-of select="ap"/><xsl:if test="mode != ''">, Mode <xsl:value-of select="mode"/></xsl:if>.&lt;/p&gt;<br/>
          </xsl:when>
          <xsl:otherwise></xsl:otherwise>
        </xsl:choose>
        <xsl:if test="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft'))]">
          :&lt;p align="justify"&gt; Software:
          <xsl:for-each select="children/gear[(isos = 'True' or isprogram = 'True' or contains(category, 'Soft'))]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="children/gear[issin = 'True' or contains(name, 'SIN,')]">
          :&lt;p align="justify"&gt; Linked SIN(s):
          <xsl:for-each select="children/gear[issin = 'True' or contains(name, 'SIN,')]">
            <xsl:sort select="concat(gearname, name, extra)"/>
            <xsl:choose>
              <xsl:when test="contains(name, ',')">
                <xsl:value-of select="substring-before(name, ',')"/> (<xsl:value-of select="normalize-space(substring-after(name, ','))"/>,
                <xsl:if test="rating != 0">Rating <xsl:value-of select="rating"/>,</xsl:if>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="name"/>
                <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>,</xsl:if>
              </xsl:otherwise>
            </xsl:choose>
            [[#sin!<xsl:value-of select="extra"/>|<xsl:value-of select="extra"/>]])
            <xsl:if test="children/gear">
              [<xsl:for-each select="children/gear">
                <xsl:sort select="concat(gearname, name)"/>
                <xsl:call-template name="text.children"/>
              </xsl:for-each>
              <xsl:text>]</xsl:text>
            </xsl:if>
            <xsl:if test="position() != last()">, </xsl:if>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="armormods/armormod or gears/gear[contains(category, 'Enhancement')] or mods/weaponmod or children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
          :&lt;p align="justify"&gt; Modifications:
          <xsl:for-each select="armormods/armormod | gears/gear[contains(category, 'Enhancement')] | mods/weaponmod | children/gear[contains(category, 'Option') or contains(category, 'Enhancement')]">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="accessories/accessory">
          :&lt;p align="justify"&gt; Accessories:
          <xsl:for-each select="accessories/accessory">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="underbarrel/weapon">
          :&lt;p align="justify"&gt; Add. Weapons:
          <xsl:for-each select="underbarrel/weapon">
            <xsl:sort select="concat(weaponname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="gears/gear[not(contains(category, 'Enhancement'))] or children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement')) and not(contains(category, 'Soft')) and not(contains(name, 'SIN,')) and isprogram = 'False' and isos = 'False' and issin = 'False']">
          :&lt;p align="justify"&gt; Incl.:
          <xsl:for-each select="gears/gear[not(contains(category, 'Enhancement'))] | children/gear[not(contains(category, 'Option')) and not(contains(category, 'Enhancement')) and not(contains(category, 'Soft')) and not(contains(name, 'SIN,')) and isprogram = 'False' and isos = 'False' and issin = 'False']">
            <xsl:sort select="concat(gearname, name)"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
        &lt;/div&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;
        <xsl:value-of select="concat(translate(substring(local-name(),1,1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring(local-name(),2,string-length(local-name())-1))"/>,
        <xsl:value-of select="category"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" |
        &lt;span style="font-weight:bold; font-style:normal;"&gt;<xsl:value-of select="location"/>&lt;/span&gt;<br/>
        &#160; | style="vertical-align:top;" | <xsl:if test="equipped = 'True'">&lt;span style="font-weight:bold; font-style:normal;"&gt;✓&lt;/span&gt;</xsl:if><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.augmentations">
    <xsl:if test="cyberwares/cyberware">
      == Augmentations ==<br/>
      <xsl:for-each select="cyberwares/cyberware">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;<xsl:value-of select="name"/>
        <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
        (<xsl:value-of select="ess"/> Essence)
        &lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;&lt;br/&gt;<br/>
        <xsl:if test="children/cyberware">
          :&lt;p align="justify"&gt;
          <xsl:for-each select="children/cyberware">
            <xsl:sort select="name"/>
            <xsl:call-template name="text.children"/>
          </xsl:for-each>
          .&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.martialarts">
    <xsl:if test="martialarts/martialart">
      == Martial Arts ==<br/>
      <xsl:for-each select="martialarts/martialart">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;<xsl:value-of select="name"/>
        <xsl:if test="rating &gt; 0">&#160;<xsl:value-of select="rating"/></xsl:if>
        &lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:for-each select="martialartadvantages/martialartadvantage">
          <xsl:sort select="name"/>
          :<xsl:value-of select="name"/><br/>
        </xsl:for-each>
      </xsl:for-each>
      <xsl:for-each select="martialartmaneuvers/martialartmaneuver">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;<xsl:value-of select="name"/>&lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;&lt;br/&gt;<br/>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.qualities">
    <xsl:if test="qualities/quality | critterpowers/critterpower[category = 'Weakness']">
      == Qualities ==<br/>
      <xsl:for-each select="qualities/quality | critterpowers/critterpower[category = 'Weakness']">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;
        <xsl:value-of select="name"/>
        <xsl:if test="(name = 'Magician' or name = 'Mystic Adept') and ../../tradition != ''">&#160;(<xsl:value-of select="../../tradition"/>)</xsl:if>
        <xsl:if test="name = 'Technomancer' and not(../../stream = '' or ../../stream = 'Default')">&#160;(<xsl:value-of select="../../stream"/>)</xsl:if>
        <xsl:if test="extra != ''">&#160;(<xsl:value-of select="extra"/>)</xsl:if>
        &lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.powers">
    <xsl:if test="powers/power | critterpowers/critterpower[category != 'Weakness']">
      == Powers ==<br/>
      <xsl:for-each select="powers/power | critterpowers/critterpower[category != 'Weakness']">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;
        <xsl:value-of select="name"/>
        <xsl:if test="rating &gt; 0">&#160;<xsl:value-of select="rating"/></xsl:if>
        <xsl:if test="extra != ''">&#160;(<xsl:value-of select="extra"/>)</xsl:if>
        &lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.complexforms">
    <xsl:if test="techprograms/techprogram">
      == Complex Forms ==<br/>
      <xsl:for-each select="techprograms/techprogram">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;
        <xsl:value-of select="name"/>
        <xsl:if test="rating &gt; 0">&#160;<xsl:value-of select="rating"/></xsl:if>
        <xsl:if test="extra != ''">&#160;(<xsl:value-of select="extra"/>)</xsl:if>
        &lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        <xsl:if test="programoptions/programoption">
          :&lt;p align="justify"&gt;Options:
          <xsl:for-each select="programoptions/programoption">
            <xsl:sort select="name"/>
            <xsl:value-of select="name"/>
            <xsl:if test="rating &gt; 0"><xsl:text> </xsl:text><xsl:value-of select="rating"/></xsl:if>
            <xsl:if test="position() != last()">, </xsl:if>
          </xsl:for-each>.&lt;/p&gt;<br/>
        </xsl:if>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.spells">
    <xsl:if test="spells/spell">
      == Spells ==<br/>
      <xsl:for-each select="spells/spell">
        <xsl:sort select="name"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;
        <xsl:value-of select="name"/>
        <xsl:if test="rating &gt; 0">&#160;<xsl:value-of select="rating"/></xsl:if>
        <xsl:if test="extra != ''">&#160;(<xsl:value-of select="extra"/>)</xsl:if>
        &lt;/span&gt;
        &lt;span class="ref"&gt; (<xsl:value-of select="source"/>&#160;<xsl:value-of select="page"/>)&lt;/span&gt;<br/>
        :&lt;p align="justify"&gt;<xsl:value-of select="category"/> Spell<xsl:if test="descriptors != ''"> (<xsl:value-of select="descriptors"/>)</xsl:if>:
        <xsl:if test="type != ''">type <xsl:value-of select="type"/>, </xsl:if>
        <xsl:if test="range != ''">range <xsl:value-of select="range"/>, </xsl:if>
        <xsl:if test="damage != ''">damage <xsl:value-of select="damage"/>, </xsl:if>
        <xsl:if test="duration != ''">duration <xsl:value-of select="duration"/>, </xsl:if>
        DV <xsl:value-of select="dv"/>.&lt;/p&gt;<br/>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.contacts">
    <xsl:if test="contacts/contact">
      == Contacts ==<br/>
      <xsl:for-each select="contacts/contact">
        <xsl:sort select="concat(type, name)"/>
        ;&lt;span id="<xsl:value-of select="name"/>"&gt;
        <xsl:value-of select="name"/>
        &lt;/span&gt;
        &lt;span class="ref"&gt;
        <xsl:choose>
          <xsl:when test="type = 'Contact'">(Contact, Connection <xsl:value-of select="connection"/>, Loyalty <xsl:value-of select="loyalty"/>)<br/></xsl:when>
          <xsl:when test="type = 'Enemy'">(Enemy, Connection <xsl:value-of select="connection"/>, Incidence <xsl:value-of select="loyalty"/>)<br/></xsl:when>
          <xsl:otherwise>(Pet)<br/></xsl:otherwise>
        </xsl:choose>
        &lt;/span&gt;<br/>
        <xsl:if test="notes != ''">
          :&lt;p align="justify"&gt;<xsl:call-template name="text.multiline"><xsl:with-param name="text" select="notes"/></xsl:call-template>&lt;/p&gt;<br/>
        </xsl:if>
      </xsl:for-each>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.spirites">
    <xsl:if test="spirits/spirit">
      <xsl:choose>
        <xsl:when test="technomancer = 'True'">== Sprites ==<br/></xsl:when>
        <xsl:otherwise>== Spirits ==<br/></xsl:otherwise>
      </xsl:choose>
      {| class="hover zebra sortable" style="table-layout:fixed; width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! width="178px" | Type<br/>
      &#160; ! width="178px" | Name<br/>
      &#160; ! width="53px" | Force<br/>
      &#160; ! width="53px" | Serv.<br/>
      &#160; ! width="53px" | <xsl:choose>
        <xsl:when test="technomancer = 'True'">Reg'd</xsl:when>
        <xsl:otherwise>Bound</xsl:otherwise>
      </xsl:choose><br/>
      &#160; ! Notes<br/>
      <xsl:for-each select="spirits/spirit">
        <xsl:sort select="name"/>
        &#160; |-<br/>
        &#160; || <xsl:value-of select="name"/> || <xsl:value-of select="crittername"/><br/>
        &#160; | style="text-align:center;" | <xsl:value-of select="force"/><br/>
        &#160; | style="text-align:center;" | <xsl:value-of select="services"/><br/>
        &#160; | style="text-align:center;" | <xsl:if test="bound = 'True'">V</xsl:if> || <xsl:value-of select="notes"/><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.karma">
    <xsl:if test="expenses/expense[type = 'Karma']">
      == Karma Expenses ==<br/>
      {| class="hover zebra" cellpadding="5px" style="width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! width="118px" | Date<br/>
      &#160; ! width="63px" | Amount<br/>
      &#160; ! Reason<br/>
      &#160; ! width="63px" | Result<br/>
      <xsl:for-each select="expenses/expense[type = 'Karma']">
        <xsl:sort select="position()" order="descending" data-type="number"/>
        &#160; |-<br/>
        || <xsl:value-of select="date"/><br/>
        &#160; | style="text-align:right;" | <xsl:value-of select="amount"/>
        || <xsl:value-of select="reason"/><br/>
        &#160; | style="text-align:right;" | <xsl:value-of select="sum(following-sibling::expense[type = 'Karma']/amount)+amount"/><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="section.nuyen">
    <xsl:if test="expenses/expense[type = 'Nuyen']">
      == Nuyen Expenses ==<br/>
      {| class="hover zebra" cellpadding="5px" style="width:100%;"<br/>
      &#160; |-<br/>
      &#160; ! width="118px" | Date<br/>
      &#160; ! width="63px" | Amount<br/>
      &#160; ! Reason<br/>
      &#160; ! width="63px" | Result<br/>
      <xsl:for-each select="expenses/expense[type = 'Nuyen']">
        <xsl:sort select="position()" order="descending" data-type="number"/>
        &#160; |-<br/>
        &#160; || <xsl:value-of select="date"/><br/>
        &#160; | style="text-align:right;" | <xsl:value-of select="amount"/>
        || <xsl:value-of select="reason"/><br/>
        &#160; | style="text-align:right;" | <xsl:value-of select="sum(following-sibling::expense[type = 'Nuyen']/amount)+amount"/><br/>
      </xsl:for-each>
      |}<br/>
      &lt;br/&gt;<br/><br/>
    </xsl:if>
  </xsl:template>

  <xsl:template name="text.children">
    <xsl:if test="qty &gt; 1"><xsl:value-of select="qty"/>x </xsl:if>
    <xsl:if test="notes != ''">{{Tooltip|Text=</xsl:if>
    <xsl:choose>
      <xsl:when test="concat(weaponname, gearname) != ''">
        <xsl:value-of select="concat(weaponname, gearname)"/>
      </xsl:when>
      <xsl:when test="name = 'Custom Placeholder' and extra != ''">
        <xsl:value-of select="extra"/>
      </xsl:when>
      <xsl:when test="contains(name, ',')">
        <xsl:value-of select="substring-before(name, ',')"/> (<xsl:value-of select="normalize-space(substring-after(name, ','))"/>)
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="name"/>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:if test="(extra != '') and (name != 'Custom Placeholder')"> (<xsl:value-of select="extra"/>)</xsl:if>
    <xsl:if test="rating != 0"> (Rating <xsl:value-of select="rating"/>)</xsl:if>
    <xsl:if test="notes != ''">|Style=text-align:justify;|Popup=<xsl:value-of select="normalize-space(notes)"/>}}</xsl:if>
    <xsl:if test="./*/*/*">
      <xsl:text> &lt;span style="opacity:0.67;"&gt;[</xsl:text>
      <xsl:for-each select="./*/*">
        <xsl:sort select="concat(weaponname, gearname, name, extra)"/>
        <xsl:call-template name="text.children"/>
      </xsl:for-each>
      <xsl:text>]&lt;/span&gt;</xsl:text>
    </xsl:if>
    <xsl:if test="position() != last()">, </xsl:if>
  </xsl:template>

  <xsl:template name="text.headers">
    <xsl:param name="text"/>
    [[<xsl:value-of select="substring-before(substring-after($text, '[['), ']]')"/>]]<br/>
    <xsl:if test="contains(substring-after($text, ']]'), '[[') and contains(substring-after($text, ']]'), ']]')">
      <xsl:call-template name="text.headers">
        <xsl:with-param name="text">
          <xsl:value-of select="substring-after($text, ']]')"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name="text.list">
    <xsl:value-of select="name"/>
    <xsl:if test="spec != ''">&#160;[<xsl:value-of select="spec"/>]</xsl:if>
    <xsl:if test="extra != ''"> (<xsl:value-of select="extra"/>)</xsl:if>
    <xsl:choose>
      <xsl:when test="rating != 0">&amp;#160;<xsl:value-of select="rating"/></xsl:when>
      <xsl:when test="rating = 0 and islanguage = 'True'">&amp;#160;N</xsl:when>
    </xsl:choose>
    <xsl:if test="./*/*">
      <xsl:text> [</xsl:text>
      <xsl:for-each select="./*/*">
        <xsl:sort select="concat(name, spec, extra)"/>
        <xsl:call-template name="text.children"/>
      </xsl:for-each>
      <xsl:text>]</xsl:text>
    </xsl:if>
    <xsl:if test="position() != last()">, </xsl:if>
  </xsl:template>

  <xsl:template name="text.multiline">
    <xsl:param name="text"/>
    <xsl:choose>
      <xsl:when test="contains($text,'&#xA;')">
        <xsl:choose>
          <xsl:when test="normalize-space(substring-before($text,'&#xA;')) != ''">
            <xsl:value-of select="substring-before($text,'&#xA;')"/>&lt;br/&gt;
          </xsl:when>
          <xsl:otherwise>
            &lt;/p&gt;&lt;p align="justify"&gt;
          </xsl:otherwise>
        </xsl:choose>
        <xsl:call-template name="text.multiline">
          <xsl:with-param name="text">
            <xsl:value-of select="substring-after($text,'&#xA;')"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$text"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="text.quotes">
    <xsl:param name="text"/>
    {{Q|<xsl:value-of select="substring-before(substring-after($text, '{{Q|'), '}}')"/>}}<br/>
    <xsl:if test="contains(substring-after($text, '}}'), '{{Q|') and contains(substring-after($text, '}}'), '}}')">
      <xsl:call-template name="text.quotes">
        <xsl:with-param name="text">
          <xsl:value-of select="substring-after($text, '}}')"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>