Switching to machine XML files that use a machine 'type' attribute rather than 'class'; 'class' can still be used to specify the machine type if 'type' is omitted, but going forward, it should only be used to specify an alternate CSS class

This commit is contained in:
Jeff Parsons 2017-01-31 22:06:13 -08:00 • committed by Jeff Parsons
commit df78f3c476
44 changed files with 13910 additions and 0 deletions

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;"> <!ENTITY sect "&#167;"> <!ENTITY copy "&#169;"> <!ENTITY para "&#182;"> <!ENTITY ndash "&#8211;"> <!ENTITY mdash "&#8212;">
<!ENTITY lsquo "&#8216;"> <!ENTITY rsquo "&#8217;"> <!ENTITY ldquo "&#8220;"> <!ENTITY rdquo "&#8221;"> <!ENTITY dagger "&#8224;"> <!ENTITY Dagger "&#8225;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output doctype-system="about:legacy-compat" method="html"/>
<xsl:include href="/versions/pdpjs/1.33.1/common.xsl"/>
<xsl:include href="/versions/pdpjs/1.33.1/components.xsl"/>
<xsl:template match="/machine">
<xsl:variable name="machineType">
<xsl:choose>
<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="machineClass">
<xsl:choose>
<xsl:when test="@class = 'pc' or @class = 'c1p'"><xsl:value-of select="@class"/>js</xsl:when>
<xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<html lang="en">
<head>
<title><xsl:value-of select="$SITEHOST"/></title>
<xsl:call-template name="commonStyles"/>
<xsl:call-template name="componentStyles"/>
</head>
<body>
<div class="common">
<xsl:call-template name="commonTop"/>
<div class="common-middle">
<p></p>
<div id="{@id}" class="machine {$machineType} {$machineClass}">
<xsl:call-template name="component">
<xsl:with-param name="machine" select="@id"/>
<xsl:with-param name="component" select="'machine'"/>
<xsl:with-param name="class" select="$machineClass"/>
<xsl:with-param name="parms"><xsl:if test="@parms">,<xsl:value-of select="@parms"/></xsl:if></xsl:with-param>
</xsl:call-template>
</div>
</div>
<xsl:call-template name="commonBottom"/>
</div>
<xsl:call-template name="componentScripts">
<xsl:with-param name="component">
<xsl:choose>
<xsl:when test="debugger"><xsl:value-of select="$machineType"/>-dbg</xsl:when>
<xsl:otherwise><xsl:value-of select="$machineType"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</body>
</html>
</xsl:template>
</xsl:stylesheet>