Advertisement
legacyking

Skills (1 of 2)

Apr 17th, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 11.45 KB | None | 0 0
  1.     <!--
  2. ====================================
  3. ====================================
  4.     TEMPLATE - SKILLS TABLE
  5. ====================================
  6. ====================================-->
  7.     <xsl:template match="skills">
  8.         <xsl:param name="first_skill" select="0"/>
  9.         <xsl:param name="last_skill" select="0"/>
  10.         <xsl:param name="column_width" select="0.55 * $pagePrintableWidth"/>
  11.         <!-- begin skills table -->
  12.        
  13.         <xsl:if test="count(skill) &gt;= $first_skill">
  14.             <xsl:variable name="columns">
  15.                 <fo:table-column column-width="4mm"/>
  16.                 <fo:table-column>
  17.                     <xsl:attribute name="column-width"><xsl:value-of select="$column_width - 42" />mm</xsl:attribute>
  18.                 </fo:table-column>
  19.                 <fo:table-column column-width="1mm"/>
  20.                 <fo:table-column column-width="1mm"/>
  21.                 <fo:table-column column-width="6mm"/>
  22.                 <fo:table-column column-width="1mm"/>
  23.                 <fo:table-column column-width="1mm"/>
  24.                 <fo:table-column column-width="6mm"/>
  25.                 <fo:table-column column-width="1mm"/>
  26.                 <fo:table-column column-width="1mm"/>
  27.                 <fo:table-column column-width="5mm"/>
  28.                 <fo:table-column column-width="1mm"/>
  29.                 <fo:table-column column-width="1mm"/>
  30.                 <fo:table-column column-width="5mm"/>
  31.                 <fo:table-column column-width="1mm"/>
  32.                 <fo:table-column column-width="1mm"/>
  33.                 <fo:table-column column-width="6mm"/>
  34.             </xsl:variable>
  35.  
  36.             <fo:table table-layout="fixed" border-collapse="collapse" padding="0.5pt">
  37.                 <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'skills.border'"/></xsl:call-template>
  38.                 <xsl:copy-of select="$columns"/>
  39.                 <fo:table-body>
  40.                     <fo:table-row height="2pt">
  41.                         <fo:table-cell/>
  42.                     </fo:table-row>
  43.                     <fo:table-row>
  44.                         <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'skills.header'"/></xsl:call-template>
  45.                         <fo:table-cell></fo:table-cell>
  46.                         <fo:table-cell number-columns-spanned="2" border-top-width="1pt" border-left-width="0pt" border-right-width="0pt" border-bottom-width="0pt">
  47.                             <fo:block text-align="left" space-before.optimum="4pt" line-height="4pt" font-size="5pt">
  48.                                 <xsl:text>TOTAL SKILLPOINTS: </xsl:text>
  49.                                 <xsl:choose>
  50.                                 <xsl:when test="skillpoints/eclipse_total &gt; 0"> 
  51.                                     <xsl:value-of select="skillpoints/eclipse_total"/>
  52.                                 </xsl:when>
  53.                                 <xsl:otherwise>
  54.                                 <xsl:value-of select="skillpoints/total"/>
  55.                                 <xsl:if test="skillpoints/unused &gt; 0">
  56.                                     <xsl:text> (UNUSED: </xsl:text>
  57.                                     <xsl:value-of select="skillpoints/unused"/>
  58.                                     <xsl:text>)</xsl:text>
  59.                                 </xsl:if>
  60.                                 </xsl:otherwise>
  61.                                 </xsl:choose>
  62.                             </fo:block>
  63.                         </fo:table-cell>
  64.                         <fo:table-cell number-columns-spanned="4">
  65.                             <fo:block text-align="end" line-height="10pt" font-weight="bold" font-size="10pt">SKILLS</fo:block>
  66.                         </fo:table-cell>
  67.                         <fo:table-cell number-columns-spanned="10">
  68.                                 <fo:block text-align="end" space-before.optimum="4pt" line-height="4pt" font-size="5pt">
  69.                                     <xsl:text>MAX RANKS: </xsl:text>
  70.                                     <xsl:value-of select="max_class_skill_level"/>/<xsl:value-of select="max_cross_class_skill_level"/>
  71.                                 </fo:block>
  72.                         </fo:table-cell>
  73.                     </fo:table-row>
  74.                     <fo:table-row>
  75.                         <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'skills.header'"/></xsl:call-template>
  76.                         <fo:table-cell></fo:table-cell>
  77.                         <fo:table-cell number-columns-spanned="2">
  78.                             <fo:block font-weight="bold" font-size="8pt">
  79.                                 SKILL NAME
  80.                             </fo:block>
  81.                         </fo:table-cell>
  82.                         <fo:table-cell number-columns-spanned="3">
  83.                             <fo:block font-size="3pt">
  84.                                 KEY ABILITY
  85.                             </fo:block>
  86.                         </fo:table-cell>
  87.                         <fo:table-cell number-columns-spanned="3">
  88.                             <fo:block text-align="center" font-size="3pt">
  89.                                 SKILL MODIFIER
  90.                             </fo:block>
  91.                         </fo:table-cell>
  92.                         <fo:table-cell number-columns-spanned="3">
  93.                             <fo:block text-align="center" font-size="3pt">
  94.                                 ABILITY MODIFIER
  95.                             </fo:block>
  96.                         </fo:table-cell>
  97.                         <fo:table-cell number-columns-spanned="3">
  98.                             <fo:block text-align="center" font-size="3pt">
  99.                                 RANKS
  100.                             </fo:block>
  101.                         </fo:table-cell>
  102.                         <fo:table-cell number-columns-spanned="2">
  103.                             <fo:block text-align="center" font-size="3pt">
  104.                                 MISC MODIFIER
  105.                             </fo:block>
  106.                         </fo:table-cell>
  107.                     </fo:table-row>
  108.                 </fo:table-body>
  109.             </fo:table>
  110.  
  111.  
  112.  
  113.  
  114.             <fo:table table-layout="fixed" border-collapse="collapse" padding="0.5pt">
  115.                 <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'skills.border'"/></xsl:call-template>
  116.                 <xsl:copy-of select="$columns"/>
  117.                 <fo:table-body>
  118.                     <xsl:for-each select="skill">
  119.                         <xsl:if test="position() &gt;= $first_skill and position() &lt;= $last_skill">
  120.                             <xsl:variable name="shade">
  121.                                 <xsl:choose>
  122.                                     <xsl:when test="position() mod 2 = 0">darkline</xsl:when>
  123.                                     <xsl:otherwise>lightline</xsl:otherwise>
  124.                                 </xsl:choose>
  125.                             </xsl:variable>
  126.                             <fo:table-row>
  127.                                 <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="concat('skills.', $shade)"/></xsl:call-template>
  128.                                 <fo:table-cell>
  129.                                     <fo:block font-size="6pt" font-family="ZapfDingbats">
  130.                                         <xsl:if test="translate( substring(untrained,1,1), 'Y', 'y')='y'">
  131.                                             &#x2713;
  132.                                         </xsl:if>
  133.                                         <xsl:if test="translate( substring(exclusive,1,1), 'Y', 'y')='y'">
  134.                                             &#x2717;
  135.                                         </xsl:if>
  136.                                     </fo:block>
  137.                                 </fo:table-cell>
  138.                                 <fo:table-cell>
  139.                                     <xsl:choose>
  140.                                     <!-->   <xsl:when test="string-length(name) &lt; 40">-->
  141.                                         <xsl:when test="not(contains(type, 'SkillUse')) and string-length(name) &lt; 40">
  142.                                             <fo:block space-before.optimum="1pt" font-size="7pt">
  143.                                                 <xsl:value-of select="name"/>
  144.                                             </fo:block>
  145.                                         </xsl:when>
  146.                                         <xsl:when test="contains(type, 'SkillUse') and string-length(name) &lt; 40">
  147.                                             <fo:block space-before.optimum="1pt" font-size="7pt" font-style="italic">
  148.                                                 <xsl:value-of select="name"/>
  149.                                             </fo:block>
  150.                                         </xsl:when>
  151.                                         <xsl:when test="not(contains(type, 'SkillUse')) and string-length(name) &lt; 45">
  152.                                             <fo:block space-before.optimum="1pt" font-size="6pt">
  153.                                                 <xsl:value-of select="name"/>
  154.                                             </fo:block>
  155.                                         </xsl:when>
  156.                                         <xsl:when test="contains(type, 'SkillUse') and string-length(name) &lt; 45">
  157.                                             <fo:block space-before.optimum="1pt" font-size="6pt" font-style="italic">
  158.                                                 <xsl:value-of select="name"/>
  159.                                             </fo:block>
  160.                                         </xsl:when>
  161.                                         <xsl:when test="contains(type, 'SkillUse') and string-length(name) &gt; 44">
  162.                                             <fo:block space-before.optimum="1pt" font-size="4pt" font-style="italic">
  163.                                                 <xsl:value-of select="name"/>
  164.                                             </fo:block>
  165.                                         </xsl:when>
  166.                                         <xsl:otherwise>
  167.                                             <fo:block space-before.optimum="1pt" font-size="4pt">
  168.                                                 <xsl:value-of select="name"/>
  169.                                             </fo:block>
  170.                                         </xsl:otherwise>
  171.                                     </xsl:choose>
  172.                                 </fo:table-cell>
  173.                                 <fo:table-cell number-columns-spanned="2"/>
  174.                                 <fo:table-cell>
  175.                                     <fo:block space-before.optimum="1pt" font-size="8pt">
  176.                                         <xsl:value-of select="ability"/>
  177.                                     </fo:block>
  178.                                 </fo:table-cell>
  179.                                 <fo:table-cell number-columns-spanned="2"/>
  180.                                 <fo:table-cell>
  181.                                     <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="concat('skills.', $shade, '.total')"/></xsl:call-template>
  182.                                     <fo:block text-align="center" space-before.optimum="1pt" font-size="8pt">
  183.                                         <xsl:choose>
  184.                                             <xsl:when test="contains($skillmastery,name)">
  185.                                                 <xsl:value-of select="concat(skill_mod,'*')"/>
  186.                                             </xsl:when>
  187.                                             <xsl:otherwise>
  188.                                                 <xsl:value-of select="skill_mod"/>
  189.                                             </xsl:otherwise>
  190.                                         </xsl:choose>
  191.                                     </fo:block>
  192.                                 </fo:table-cell>
  193.                                 <fo:table-cell number-columns-spanned="2">
  194.                                     <fo:block text-align="center" space-before.optimum="3pt" line-height="6pt" font-size="6pt">=</fo:block>
  195.                                 </fo:table-cell>
  196.                                 <fo:table-cell>
  197.                                     <fo:block text-align="center" space-before.optimum="1pt" font-size="8pt">
  198.                                         <xsl:value-of select="ability_mod"/>
  199.                                     </fo:block>
  200.                                 </fo:table-cell>
  201.                                 <fo:table-cell number-columns-spanned="2">
  202.                                     <fo:block text-align="center" space-before.optimum="3pt" line-height="6pt" font-size="6pt">
  203.                                         <xsl:if test="ranks &gt; 0">+</xsl:if>
  204.                                     </fo:block>
  205.                                 </fo:table-cell>
  206.                                 <fo:table-cell>
  207.                                     <fo:block text-align="center" space-before.optimum="1pt" font-size="8pt">
  208.                                         <xsl:if test="ranks &gt; 0">
  209.                                             <xsl:if test="contains(type, 'SkillUse')">[</xsl:if>
  210.                                             <xsl:choose>
  211.                                                 <xsl:when test="round(ranks) = ranks">
  212.                                                     <xsl:value-of select="round(ranks)"/>
  213.                                                 </xsl:when>
  214.                                                 <xsl:otherwise>
  215.                                                     <xsl:value-of select="ranks"/>
  216.                                                 </xsl:otherwise>
  217.                                             </xsl:choose>
  218.                                             <xsl:if test="contains(type, 'SkillUse')">]</xsl:if>
  219.                                         </xsl:if>
  220.                                        
  221. <!-->                                       <xsl:if test="ranks>0">
  222.                                             <xsl:value-of select="ranks"/>
  223.                                             </xsl:if>-->
  224.                                     </fo:block>
  225.                                 </fo:table-cell>
  226.                                 <fo:table-cell number-columns-spanned="2">
  227.                                     <fo:block text-align="center" space-before.optimum="3pt" line-height="6pt" font-size="6pt">
  228.                                         <xsl:if test="misc_mod!=0">+</xsl:if>
  229.                                     </fo:block>
  230.                                 </fo:table-cell>
  231.                                 <fo:table-cell>
  232.                                     <fo:block text-align="center" space-before.optimum="1pt" font-size="8pt">
  233.                                         <xsl:if test="misc_mod!=0">
  234.                                             <xsl:value-of select="misc_mod"/>
  235.                                         </xsl:if>
  236.                                     </fo:block>
  237.                                 </fo:table-cell>
  238.                             </fo:table-row>
  239.                         </xsl:if>
  240.                     </xsl:for-each>
  241.                     <xsl:call-template name="skills.empty"><xsl:with-param name="pos" select="count(skill)+1"/></xsl:call-template>
  242.                     <xsl:call-template name="skills.empty"><xsl:with-param name="pos" select="count(skill)+2"/></xsl:call-template>
  243.                     <fo:table-row>
  244.                         <fo:table-cell number-columns-spanned="17" padding-top="1pt">
  245.                             <fo:block text-align="center" font-size="6pt">
  246.                                 <fo:inline font-family="ZapfDingbats">&#x2713;</fo:inline>: can be used untrained.
  247.                                 <fo:inline font-family="ZapfDingbats">&#x2717;</fo:inline>: exclusive skills.
  248.                                 *: Skill Mastery.
  249.                             </fo:block>
  250.                         </fo:table-cell>
  251.                     </fo:table-row>
  252.                 </fo:table-body>
  253. <!-- This is going to be the new Skill Info Section--> 
  254. <!-->           <xsl:if test="count(conditional_modifiers/skillbonus) &gt; 0">
  255.                 <fo:table-body border-collapse="collapse" padding="0.5pt">
  256.                     <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'skills.border'"/></xsl:call-template>
  257.                     <fo:table-row>
  258.                         <fo:table-cell number-columns-spanned="17" padding-top="1pt">
  259.                             <fo:block text-align="center" font-size="8pt" font-weight="bold">Conditional Modifiers:</fo:block>
  260.                                 <xsl:for-each select="conditional_modifiers/skillbonus">
  261.                                     <fo:block font-size="8pt" space-before.optimum="2pt"><xsl:value-of select="description"/></fo:block>
  262.                                 </xsl:for-each>
  263.                         </fo:table-cell>
  264.                     </fo:table-row>
  265.                 </fo:table-body>
  266.             </xsl:if>-->
  267. <!-- End New Skill Info Section-->
  268.             </fo:table>
  269.         </xsl:if>
  270.         <!-- END Skills table-->
  271.     </xsl:template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement