Skip to content

Commit

Permalink
Canonicalize XSLT
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin C. Baird committed Nov 14, 2014
1 parent bd0f64f commit 82d4bd3
Show file tree
Hide file tree
Showing 75 changed files with 2,237 additions and 2,402 deletions.
28 changes: 13 additions & 15 deletions xslt/atomic-robo_html.xsl
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/atomic-robo/character.xsl"/>
<xsl:include href="html/atomic-robo/copyright.xsl"/>
<xsl:include href="html/atomic-robo/experience_points.xsl"/>
<xsl:include href="html/atomic-robo/experiences.xsl"/>
<xsl:include href="html/atomic-robo/stress.xsl"/>
<xsl:include href="html/atomic-robo/stunts.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/atomic-robo/character.xsl"/>
<xsl:include href="html/atomic-robo/copyright.xsl"/>
<xsl:include href="html/atomic-robo/experience_points.xsl"/>
<xsl:include href="html/atomic-robo/experiences.xsl"/>
<xsl:include href="html/atomic-robo/stress.xsl"/>
<xsl:include href="html/atomic-robo/stunts.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
</xsl:stylesheet>
30 changes: 14 additions & 16 deletions xslt/diaspora_html.xsl
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:variable name="useConditions">false</xsl:variable>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/fate-common/stunts.xsl"/>
<xsl:include href="html/diaspora/character.xsl"/>
<xsl:include href="html/diaspora/copyright.xsl"/>
<xsl:include href="html/diaspora/gear.xsl"/>
<xsl:include href="html/diaspora/id.xsl"/>
<xsl:include href="html/diaspora/stress.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:variable name="useConditions">false</xsl:variable>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/fate-common/stunts.xsl"/>
<xsl:include href="html/diaspora/character.xsl"/>
<xsl:include href="html/diaspora/copyright.xsl"/>
<xsl:include href="html/diaspora/gear.xsl"/>
<xsl:include href="html/diaspora/id.xsl"/>
<xsl:include href="html/diaspora/stress.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
</xsl:stylesheet>
16 changes: 7 additions & 9 deletions xslt/fae_html.xsl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fae/fae_common.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fae/fae_common.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
</xsl:stylesheet>
28 changes: 13 additions & 15 deletions xslt/fate-freeport_html.xsl
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/fate-common/stunts.xsl"/>
<xsl:include href="html/fcs/phase-trio.xsl"/>
<xsl:include href="html/fate-freeport/skills.xsl"/>
<xsl:include href="html/fate-freeport/stress.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character">
<xsl:with-param name="moreCSS">freeport</xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/fate-common/stunts.xsl"/>
<xsl:include href="html/fcs/phase-trio.xsl"/>
<xsl:include href="html/fate-freeport/skills.xsl"/>
<xsl:include href="html/fate-freeport/stress.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character">
<xsl:with-param name="moreCSS">freeport</xsl:with-param>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
22 changes: 10 additions & 12 deletions xslt/fcs_html.xsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/fate-common/stunts.xsl"/>
<xsl:include href="html/fcs/phase-trio.xsl"/>
<xsl:include href="html/fcs/stress.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:include href="html/fcs/fcs_common.xsl"/>
<xsl:include href="html/fate-common/stunts.xsl"/>
<xsl:include href="html/fcs/phase-trio.xsl"/>
<xsl:include href="html/fcs/stress.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="character"/>
</xsl:template>
</xsl:stylesheet>
42 changes: 19 additions & 23 deletions xslt/html/atomic-robo/calculate-stress.xsl
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>

<xsl:template name="calculate-stress">
<xsl:param name="stressType"/>
<xsl:variable name="matchingModeCount">
<xsl:value-of select="count(/character/skills/mode[@stress-type=$stressType])"/>
</xsl:variable>
<xsl:variable name="matchingModeRatingsSum">
<xsl:variable name="matchingModeRatingsPure">
<xsl:value-of select="sum(/character/skills/mode[@stress-type=$stressType]/@rating)"/>
</xsl:variable>
<xsl:variable name="matchingModeRatingsSplit">
<xsl:value-of select="floor(sum(/character/skills/mode[@stress-type='split']/@rating) div 2)"/>
</xsl:variable>
<xsl:value-of select="$matchingModeRatingsPure + $matchingModeRatingsSplit"/>
</xsl:variable>
<xsl:value-of select="2 + $matchingModeRatingsSum - $matchingModeCount"/>
</xsl:template>

<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template name="calculate-stress">
<xsl:param name="stressType"/>
<xsl:variable name="matchingModeCount">
<xsl:value-of select="count(/character/skills/mode[@stress-type=$stressType])"/>
</xsl:variable>
<xsl:variable name="matchingModeRatingsSum">
<xsl:variable name="matchingModeRatingsPure">
<xsl:value-of select="sum(/character/skills/mode[@stress-type=$stressType]/@rating)"/>
</xsl:variable>
<xsl:variable name="matchingModeRatingsSplit">
<xsl:value-of select="floor(sum(/character/skills/mode[@stress-type='split']/@rating) div 2)"/>
</xsl:variable>
<xsl:value-of select="$matchingModeRatingsPure + $matchingModeRatingsSplit"/>
</xsl:variable>
<xsl:value-of select="2 + $matchingModeRatingsSum - $matchingModeCount"/>
</xsl:template>
</xsl:stylesheet>
148 changes: 73 additions & 75 deletions xslt/html/atomic-robo/character.xsl
Original file line number Diff line number Diff line change
@@ -1,76 +1,74 @@
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="character">
<xsl:variable name="useConditions">
<xsl:choose>
<xsl:when test="hacks/@conditions='true'">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="useSkillModes">true</xsl:variable>
<html>
<xsl:call-template name="head">
<xsl:with-param name="baseCSS">fcs</xsl:with-param>
<xsl:with-param name="moreCSS">atomic-robo</xsl:with-param>
</xsl:call-template>
<body>
<h1>
<xsl:value-of select="id/charname"/>
</h1>
<div id="id">
<xsl:apply-templates select="id"/>
</div>
<div id="fate-logo">
<span id="atomic-robo-logo">
<img alt="Atomic Robo" src="robo_logo.gif"/>
</span>
<table>
<tr>
<xsl:call-template name="current-fate-points"/>
<xsl:call-template name="experience-points"/>
</tr>
</table>
</div>
<hr />
<div id="aspects">
<xsl:apply-templates select="aspects"/>
</div>
<div id="skills">
<xsl:apply-templates select="skills">
<xsl:with-param name="useSkillModes">
<xsl:value-of select="$useSkillModes"/>
</xsl:with-param>
</xsl:apply-templates>
</div>
<hr />
<xsl:apply-templates select="experiences"/>
<xsl:call-template name="experiences-explanation"/>
<hr />
<div id="stunts">
<xsl:apply-templates select="stunts" mode="atomic-robo"/>
</div>
<hr />
<div id="stress">
<xsl:call-template name="atomic-robo-stress"/>
</div>
<div id="consequences">
<xsl:choose>
<xsl:when test="$useConditions='true'">
<xsl:call-template name="conditions"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="consequences"/>
</xsl:otherwise>
</xsl:choose>
</div>
<hr />
<div id="notes">
<xsl:apply-templates select="notes"/>
</div>
</body>
</html>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="character">
<xsl:variable name="useConditions">
<xsl:choose>
<xsl:when test="hacks/@conditions='true'">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="useSkillModes">true</xsl:variable>
<html>
<xsl:call-template name="head">
<xsl:with-param name="baseCSS">fcs</xsl:with-param>
<xsl:with-param name="moreCSS">atomic-robo</xsl:with-param>
</xsl:call-template>
<body>
<h1>
<xsl:value-of select="id/charname"/>
</h1>
<div id="id">
<xsl:apply-templates select="id"/>
</div>
<div id="fate-logo">
<span id="atomic-robo-logo">
<img alt="Atomic Robo" src="robo_logo.gif"/>
</span>
<table>
<tr>
<xsl:call-template name="current-fate-points"/>
<xsl:call-template name="experience-points"/>
</tr>
</table>
</div>
<hr/>
<div id="aspects">
<xsl:apply-templates select="aspects"/>
</div>
<div id="skills">
<xsl:apply-templates select="skills">
<xsl:with-param name="useSkillModes">
<xsl:value-of select="$useSkillModes"/>
</xsl:with-param>
</xsl:apply-templates>
</div>
<hr/>
<xsl:apply-templates select="experiences"/>
<xsl:call-template name="experiences-explanation"/>
<hr/>
<div id="stunts">
<xsl:apply-templates select="stunts" mode="atomic-robo"/>
</div>
<hr/>
<div id="stress">
<xsl:call-template name="atomic-robo-stress"/>
</div>
<div id="consequences">
<xsl:choose>
<xsl:when test="$useConditions='true'">
<xsl:call-template name="conditions"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="consequences"/>
</xsl:otherwise>
</xsl:choose>
</div>
<hr/>
<div id="notes">
<xsl:apply-templates select="notes"/>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
14 changes: 6 additions & 8 deletions xslt/html/atomic-robo/copyright.xsl
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template name="atomic-robo-copyright">
<p id="copyright">
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template name="atomic-robo-copyright">
<p id="copyright">
Atomic Robo RPG Character Sheet ©2014 Evil Hat Productions, LLC.
</p>
</xsl:template>
</xsl:template>
</xsl:stylesheet>
28 changes: 13 additions & 15 deletions xslt/html/atomic-robo/experience_points.xsl
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template name="experience-points">
<td>
<dl id="experience-points">
<dt>Points:</dt>
<dd class="box">
<xsl:value-of select="experience-points"/>
</dd>
</dl>
</td>
</xsl:template>
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template name="experience-points">
<td>
<dl id="experience-points">
<dt>Points:</dt>
<dd class="box">
<xsl:value-of select="experience-points"/>
</dd>
</dl>
</td>
</xsl:template>
</xsl:stylesheet>
Loading

0 comments on commit 82d4bd3

Please sign in to comment.