<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"  version = "1.1" >
<xsl:preserve-space elements="*"/>
<xsl:output method="xml" indent="no"/> 
<xsl:variable name="format" select="'#0.##'" />

<xsl:template match="*" >
 <xsl:copy>
  <xsl:apply-templates select="@*|*|text()" />
 </xsl:copy><xsl:value-of select="$newline"/>
</xsl:template>

<xsl:template match="@*|text()" >
 <xsl:copy>
  <xsl:apply-templates select="@*|*|text()" />
 </xsl:copy>
</xsl:template>

<xsl:template match="camp">
<xsl:variable name="output"><output>
<xsl:for-each select="cmnd">
<xsl:choose>
<xsl:when test="@name = 'C'"></xsl:when>
<xsl:when test="@name = 'ERASE'"></xsl:when>
<xsl:when test="@name = 'FRAME'"></xsl:when>
<xsl:when test="@name = 'DRAW'">
  <xsl:variable name="s"><xsl:value-of select="@S"/></xsl:variable>
  <xsl:variable name="arr"><xsl:value-of select="@ARR"/></xsl:variable>
  <xsl:for-each select="array">
    <path>
      <xsl:call-template name="decode">
        <xsl:with-param name="cmnds" select="*"/>
        <xsl:with-param name="last" ><xsl:value-of select="''"/></xsl:with-param>
      </xsl:call-template>
    </path>
  </xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</output></xsl:variable>

<svg   xmlns="http://www.w3.org/2000/svg"  xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="384" viewBox="0 0 12 9"><xsl:text>
</xsl:text>
<style type="text/css"><xsl:text>
</xsl:text>
path.camp     {fill:none;stroke:black;stroke-width:0.05}<xsl:text>
</xsl:text>
</style><xsl:text>
</xsl:text>
<rect style="stroke:black;fill:white;stroke-width:0.1" width="12" height="9"/><xsl:text>
</xsl:text>
<g transform="translate(6,4.5)scale(1,-1)translate(-6,-4.5)"><xsl:text>
</xsl:text>
<xsl:for-each select="$output/output/path">
<path class="camp">
<xsl:attribute name="d"><xsl:value-of select="."/></xsl:attribute>
</path><xsl:text>
</xsl:text>
</xsl:for-each>

</g><xsl:text>
</xsl:text>
</svg>


</xsl:template>

<xsl:template name="decode">
<xsl:param name="cmnds"/>
<xsl:param name="last"/>
<xsl:choose>
 <xsl:when test="count($cmnds) = 0"></xsl:when>
 <xsl:otherwise>
 <xsl:choose>
 <xsl:when test="name($cmnds[1]) = 'setcv'">M<xsl:value-of select="format-number($cmnds[1]/@X1,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y1,$format)"/><xsl:text>L</xsl:text><xsl:value-of select="format-number($cmnds[1]/@X2,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y2,$format)"/>
<xsl:call-template name="decode">
<xsl:with-param name="cmnds" select="$cmnds[position() != 1]"/>
<xsl:with-param name="last" ><xsl:value-of select="'setcv'"/></xsl:with-param>
</xsl:call-template>
 </xsl:when>
 <xsl:when test="name($cmnds[1]) ='setln'">M<xsl:value-of select="format-number($cmnds[1]/@X1,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y1,$format)"/><xsl:text>L</xsl:text><xsl:value-of select="format-number($cmnds[1]/@X2,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y2,$format)"/>
 <xsl:call-template name="decode">
<xsl:with-param name="cmnds" select="$cmnds[position() != 1]"/>
<xsl:with-param name="last" ><xsl:value-of select="'setln'"/></xsl:with-param>
</xsl:call-template>
</xsl:when>
 <xsl:when test="name($cmnds[1]) ='expar'">
 <xsl:choose>
 <xsl:when test="$last = 'setcv'">L<xsl:value-of select="format-number($cmnds[1]/@X1,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y1,$format)"/><xsl:text>L</xsl:text><xsl:value-of select="format-number($cmnds[1]/@X2,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y2,$format)"/>
 <xsl:call-template name="decode">
<xsl:with-param name="cmnds" select="$cmnds[position() != 1]"/>
<xsl:with-param name="last" ><xsl:value-of select="$last"/></xsl:with-param>
</xsl:call-template>
 </xsl:when>
  <xsl:when test="$last = 'setln'">M<xsl:value-of select="format-number($cmnds[1]/@X1,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y1,$format)"/><xsl:text>L</xsl:text><xsl:value-of select="format-number($cmnds[1]/@X2,$format)"/><xsl:text>,</xsl:text><xsl:value-of select="format-number($cmnds[1]/@Y2,$format)"/>
   <xsl:call-template name="decode">
<xsl:with-param name="cmnds" select="$cmnds[position() != 1]"/>
<xsl:with-param name="last" ><xsl:value-of select="$last"/></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
 </xsl:choose>
 </xsl:when>

 </xsl:choose>
</xsl:otherwise>
</xsl:choose>


</xsl:template>

</xsl:stylesheet>