<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <head>
  <title><xsl:value-of select="m2/title"/></title>
  <style type="text/css">
  th {
    background-color:#131399;
    color:#FFFFFF;
  }
  td {
     background-color:#ECE9D8;
     color:#000000; 
  }
  </style>  
  </head>
  <body>
    <h2><xsl:value-of select="m2rsm/title"/></h2> 
    <b><a href="http://msquaredtechnologies.com/m2rsm/" target="_blank"><xsl:value-of select="m2rsm/program"/></a></b> 
    by <a href="http://msquaredtechnologies.com" target="_blank">M Squared Technologies LLC</a><br />
    <b>Version: </b><i><xsl:value-of select="m2rsm/version" /></i><br />    
    <b>Date Processed: </b><i><xsl:value-of select="m2rsm/date" /></i><br />
    <b>Command Line: </b><i><xsl:value-of select="m2rsm/command" /></i><br />
    <br />
    <b><xsl:value-of select="m2rsm/report/name" /></b><br />
    <b>Sorted By: </b><i>File Name, Ascending</i><br />
    <table border="1">
    <tr bgcolor="#1616C0" >
      <th align="left">File</th>
      <th align="left">Date</th>
      <th align="left">Size</th>
      <th align="left">LOC</th>
      <th align="left">eLOC</th>
      <th align="left">lLOC</th>
      <th align="left">Comments</th>
      <th align="left">Lines</th>
    </tr>
    <xsl:for-each select="m2rsm/report/file">
    <xsl:sort select="name" data-type="text" order="ascending" case-order="upper-first" />    
    <tr>
      <td><xsl:value-of select="name"/></td>
      <td><xsl:value-of select="date"/></td>
      <td><xsl:value-of select="size_bytes"/></td>
      <td><xsl:value-of select="loc"/></td>
      <td><xsl:value-of select="eloc"/></td>
      <td><xsl:value-of select="lloc"/></td>
      <td><xsl:value-of select="comments"/></td>
      <td><xsl:value-of select="lines"/></td>
    </tr>
    </xsl:for-each>
    </table>

    <br />
    <b>Code Maintenance and Testing Analysis</b><br />
    <b>Sorted By: </b><i>Notices per 1000 eLOC, Descending</i><br />
    <table border="1">
    <tr bgcolor="#9acd32">
      <th align="left">File</th>
      <th align="left">Functions</th>
      <th align="left">Notices</th>
      <th align="left">Notices/KeLOC</th>
      <th align="left">Parameters</th>
      <th align="left">Returns</th>
      <th align="left">Cyclomatic Vg</th>
      <th align="left">Total Complexity</th>
    </tr>
    <xsl:for-each select="m2rsm/report/file">
    <xsl:sort select="notices_per_KeLOC" data-type="number" order="descending" />
    <tr>
      <td><xsl:value-of select="name"/></td>
      <td><xsl:value-of select="function_count"/></td>
      <td><xsl:value-of select="quality_notices"/></td>
      <td><xsl:value-of select="notices_per_KeLOC"/></td>
      <td><xsl:value-of select="parameters"/></td>
      <td><xsl:value-of select="returns"/></td>
      <td><xsl:value-of select="cyclomatic_complexity"/></td>
      <td><xsl:value-of select="total_complexity"/></td>
    </tr>
    </xsl:for-each>
    </table>    

    <br />
    <b>Function Point Metrics Derivation</b><br />
    <b>Sorted By: </b><i>Function Points by eLOC, Descending</i><br />
    <table border="1">
    <tr bgcolor="#9acd32">
      <th align="left">File</th>
      <th align="left">Functions</th>
      <th align="left">FP/LOC</th>
      <th align="left">FP/eLOC</th>
      <th align="left">FP/lLOC</th>
    </tr>
    <xsl:for-each select="m2rsm/report/file">
    <xsl:sort select="function_pts_eloc" data-type="number" order="descending" />
    <tr>
      <td><xsl:value-of select="name"/></td>
      <td><xsl:value-of select="function_count"/></td>
      <td><xsl:value-of select="function_point_loc"/></td>
      <td><xsl:value-of select="function_point_eloc"/></td>
      <td><xsl:value-of select="function_point_lloc"/></td>
    </tr>
    </xsl:for-each>
    </table> 
    
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>