<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html> 
<body>
  <h2>S1000 D - Brake Repair</h2>

<!-- Module name -->
<p><h3>Module Designation</h3></p>

    <tr bgcolor="#ffffff">
      <tr style="text-align:left">TechName: </tr>
      <th style="text-align:left"><xsl:value-of select="dmodule/identAndStatusSection/dmAddress/dmAddressItems/dmTitle/techName"/></th>
     </tr>
    <tr bgcolor="#ffffff">
      <tr style="text-align:left"> InfoName: </tr>
      <th style="text-align:left"><xsl:value-of select="dmodule/identAndStatusSection/dmAddress/dmAddressItems/dmTitle/infoName"/></th>
    </tr>


<!-- Module data -->
  <p><h3>Module Ident Data</h3></p>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th style="text-align:left">Ident</th>
      <th style="text-align:left">Value</th>
    </tr>

<!-- DMC Code -->
    <xsl:for-each select="dmodule/identAndStatusSection/dmAddress/dmIdent/dmCode">
    <xsl:variable name= "a" select="@modelIdentCode"/>
    <xsl:variable name= "b" select="@systemDiffCode"/>
    <xsl:variable name= "c" select="@systemCode"/>  
    <xsl:variable name= "d" select="@subSystemCode"/>
    <xsl:variable name= "e" select="@assyCode"/>  
    <xsl:variable name= "f" select="@disassyCode"/> 
    <xsl:variable name= "g" select="@disassyCodeVariant"/> 
    <xsl:variable name= "h" select="@infoCode"/>
    <xsl:variable name= "i" select="@infoCodeVariant"/>
    <xsl:variable name= "j" select="@itemLocationCode"/>
    <xsl:variable name= "x" select="'-'"/>
    <tr>
    <td>DMC Code</td>  
    <td><xsl:value-of select="concat($a,$x,$b,$x,$c,$x,$d,$x,$e,$x,$f,$x,$g,$x,$h,$x,$i,$x,$j)"/></td>
    </tr>    
    </xsl:for-each>


    <!-- Other Module Ident Data -->

    <tr>
    <td>Language</td>
    <xsl:variable name="CIsoCode" select="dmodule/identAndStatusSection/dmAddress/dmIdent/language/@     
     countryIsoCode" /> 
    <xsl:variable name="LIsoCode" select="dmodule/identAndStatusSection/dmAddress/dmIdent/language/@     
     languageIsoCode" /> 
    <xsl:variable name="empty" select="' '" /> 
    <td><xsl:value-of select="concat($CIsoCode, $empty,$LIsoCode)"/></td>
    </tr>

  </table>

<!-- Module instructions -->
<p><h3>Instructions</h3></p>

<xsl:variable name="eTime" select="dmodule/content/procedure/preliminaryRqmts/reqPersons/person/estimatedTime"/>
<xsl:variable name="eUnit" select="dmodule/content/procedure/preliminaryRqmts/reqPersons/person/estimatedTime/@unitOfMeasure"/>


    <tr bgcolor="grey">
      <tr style="text-align:left">Person Category Code: </tr>
      <th style="text-align:left"><xsl:value-of select="dmodule/content/procedure/preliminaryRqmts/reqPersons/person/personCategory/@personCategoryCode"/></th>
     </tr>
    <tr bgcolor="LightGray">
      <tr style="text-align:left"> Estimated Time (h): </tr>
      <th style="text-align:left"><xsl:value-of select="concat($eTime,$eUnit)"/></th>
    </tr>
<p><h3></h3></p>
<xsl:text> </xsl:text>
<!-- Steps -->

<xsl:for-each select="dmodule/content/procedure/mainProcedure/proceduralStep">
    <tr bgcolor="#B0D305">
     <xsl:number value="position()" format="A" />
      <th>   </th>
      <th style="text-align:left"><xsl:value-of select="para"/></th>
     </tr>
     <th> </th>
</xsl:for-each>

</body>
</html>
</xsl:template>
</xsl:stylesheet>