Advertisement
melance

DnD 5e Monster Template

Feb 27th, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.53 KB | None | 0 0
  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.     <xsl:output method="html" version="4.0" indent="yes"/>
  3.     <xsl:preserve-space elements="*"/>
  4.    
  5.     <xsl:template match="/">
  6.         <html>
  7.             <head>
  8.                 <style>
  9.                     .sandwichBorder {
  10.                         background: #FF9933;
  11.                         height:4px;
  12.                         border-top: 1px solid black;
  13.                         border-bottom: 1px solid black;
  14.                     }
  15.                     .gradient {
  16.                         background: linear-gradient(10deg, #A73335, #FFFF99);
  17.                         height:5px;
  18.                         margin:7px 0px;
  19.                     }
  20.                     .name {
  21.                         font-size:225%;
  22.                         font-family:Georgia, serif;
  23.                         font-variant:small-caps;
  24.                         font-weight:bold;
  25.                         color:#A73335;
  26.                     }
  27.                     .description {
  28.                         font-style:italic;    
  29.                     }
  30.                     .bold {
  31.                         font-weight:bold;
  32.                     }
  33.                     .red {
  34.                         color:#A73335;
  35.                     }
  36.                     table {
  37.                         width:100%;
  38.                         border:0px;
  39.                         border-collapse:collapse;
  40.                         color:#A73335;
  41.                     }
  42.                     th, td {
  43.                         width:50px;
  44.                         text-align:center;
  45.                     }
  46.                     .actions {
  47.                         font-size:175%;
  48.                         font-variant:small-caps;
  49.                         margin:17px 0px 0px 0px;
  50.                     }
  51.                     .hr {
  52.                         background: #A73335;
  53.                         height:2px;
  54.                     }
  55.                     .attack {
  56.                         margin:5px 0px;
  57.                     }
  58.                     .attackname {
  59.                         font-weight:bold;
  60.                         font-style:italic;
  61.                     }
  62.                 </style>
  63.             </head>
  64.             <body style="background: #FFFF99;">
  65.                 <xsl:for-each select="Monsters/Monster[@Include = 'True']">
  66.                     <div contenteditable="true"  style="width:310px; font-family:Arial,Helvetica,sans-serif;font-size:11px;">
  67.                     <div class="sandwichBorder"></div>
  68.                     <div class="name"><xsl:value-of select="@Name" /></div>
  69.                     <div class="description"><xsl:value-of select="Size" />&#160;<xsl:value-of select="Type" />, <xsl:value-of select="Alignment" /></div>
  70.  
  71.                     <div class="gradient"></div>
  72.  
  73.                     <div class="red">
  74.                         <div ><span class="bold red">Armor Class</span><span>&#160;<xsl:value-of select="AC" /></span></div>
  75.                         <div><span class="bold red">Hit Points</span>&#160;<span><xsl:value-of select="HP" />&#160;(<xsl:value-of select="HD" />)</span></div>
  76.                         <div><span class="bold red">Speed</span>&#160;<span><xsl:value-of select="Speed" /></span></div>
  77.                     </div>
  78.  
  79.                     <div class="gradient"></div>
  80.  
  81.                     <table>
  82.                         <tr><th>STR</th><th>DEX</th><th>CON</th><th>INT</th><th>WIS</th><th>CHA</th></tr>
  83.                         <tr>
  84.                             <!-- <td><xsl:value-of select="STR/Value" />&#160;(<xsl:value-of select="STR/Mod" />)</td> -->
  85.                             <td><xsl:value-of select="STR" />&#160;(<xsl:value-of select="format-number(floor((STR - 10) div 2),'+#0;-#0')" />)</td>
  86.                             <td><xsl:value-of select="DEX" />&#160;(<xsl:value-of select="format-number(floor((DEX - 10) div 2),'+#0;-#0')" />)</td>
  87.                             <td><xsl:value-of select="CON" />&#160;(<xsl:value-of select="format-number(floor((CON - 10) div 2),'+#0;-#0')" />)</td>
  88.                             <td><xsl:value-of select="INT" />&#160;(<xsl:value-of select="format-number(floor((INT - 10) div 2),'+#0;-#0')" />)</td>
  89.                             <td><xsl:value-of select="WIS" />&#160;(<xsl:value-of select="format-number(floor((WIS - 10) div 2),'+#0;-#0')" />)</td>
  90.                             <td><xsl:value-of select="CHA" />&#160;(<xsl:value-of select="format-number(floor((CHA - 10) div 2),'+#0;-#0')" />)</td>
  91.                         </tr>
  92.                     </table>
  93.                        
  94.                     <div class="gradient"></div>
  95.                    
  96.                     <xsl:for-each select="Detail">
  97.                         <div><span class="bold"><xsl:value-of select="@name" /></span>&#160;<span><xsl:value-of select="text()" /></span></div>
  98.                     </xsl:for-each>
  99.                    
  100.                     <div><span class="bold">Challenge</span>&#160;<span><xsl:value-of select="CR" />&#160;(<xsl:value-of select="XP" />&#160;XP)</span></div>
  101.                        
  102.                     <div class="gradient"></div>
  103.  
  104.                     <xsl:for-each select="Abilities/Ability">
  105.                         <div class="attack"><span class="attackname"><xsl:value-of select="@name" /></span>&#160;<span><xsl:value-of select="text()" /></span></div>
  106.                     </xsl:for-each>
  107.                    
  108.                     <div class="actions red">Actions</div>
  109.                        
  110.                     <div class="hr"></div>
  111.                      
  112.                     <xsl:for-each select="Actions/Action">
  113.                         <div class="attack"><span class="attackname"><xsl:value-of select="Title" />.</span>&#160;<xsl:if test="Type != ''"><span class="description"><xsl:value-of select="Type" />:</span>&#160;</xsl:if><span><xsl:value-of select="Description" /></span>&#160;<xsl:if test="Hit != ''"><span class="description">Hit:</span>&#160;</xsl:if><span><xsl:value-of select="Hit" /></span></div>    
  114.                     </xsl:for-each>
  115.                     <div class="sandwichBorder"></div>
  116.                     </div>
  117.                     <br />
  118.                 </xsl:for-each>
  119.             </body>
  120.         </html>
  121.     </xsl:template>
  122. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement