<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version='1.0'>

<xsl:template match="/">
    <html>
    <body>

    <table width="600px" class="headerT" cellspacing="0">
        <tr>
	    <td>
               <img src="http://www.icemcfd.com/logos/ai_logo.gif"/>
            </td>
            <td>
               <h2><xsl:value-of select="mesh_report/@mesher"/> Meshing Report</h2>
               <h3>Description: <xsl:value-of select="mesh_report/@title"/></h3>
		<!-- <br/> -->
               <h3>Prepared by: <xsl:value-of select="mesh_report/@user"/></h3>
		<!-- <br/> -->
               <h3>Date: <xsl:value-of select="mesh_report/@date"/></h3>
		<!-- <br/> -->
	    </td>
        </tr>
    </table>
    <br/>

    <!-- <center> -->
    
    <h3>Mesh summary</h3>

    <xsl:for-each select="mesh_report/mesh_summary">
          <xsl:for-each select="data">
          <table class="dataT" cellspacing="0">
		<tr>
			<td colspan="4" class="dataHead"><xsl:value-of select="@name"/></td>
		</tr>
                <xsl:for-each select="datum">
                   <tr>
                      <td class="dataBod"><b><xsl:value-of select="@name"/></b></td>
                      <td class="dataBod"><xsl:value-of select="."/></td>
                   </tr>
                </xsl:for-each>
          </table>
          </xsl:for-each>
    </xsl:for-each>

    
    <h3>Mesh quality metrics</h3>
    
    <xsl:for-each select="mesh_report/mesh_quality">
          <xsl:for-each select="metric">
          <table width="500px" class="dataT" cellspacing="0">
               <tr>
	         <td colspan="20" class="dataHead"><xsl:value-of select="@name"/></td>
               </tr>
               <tr>
               <xsl:for-each select="histogram/interval">
	             <td class="dataSubHead"><xsl:value-of select="@min"/>-><xsl:value-of select="@max"/></td>
               </xsl:for-each>
               </tr>
               <tr>
               <xsl:for-each select="histogram/interval">
                     <td class="dataBod"><xsl:value-of select="."/></td>
               </xsl:for-each>
               </tr>
          </table>
          </xsl:for-each>
    </xsl:for-each>


    <h3>Mesh diagnostics</h3>

    <xsl:for-each select="mesh_report/mesh_diagnostics">
          <table width="500px" class="dataT" cellspacing="0">
          <tr>
	     <td colspan="6" class="dataHead">Mesh diagnostics: subset "<xsl:value-of select="@subset"/>"</td>
	  </tr>
          <xsl:for-each select="criterion">
                   <tr>
                      <td class="dataBod"><b><xsl:value-of select="@name"/></b></td>
                      <td class="dataBod"><xsl:value-of select="number"/></td>
                   </tr>
          </xsl:for-each>
          </table>
    </xsl:for-each>

    <!-- </center> -->
	
    </body>
    </html>

</xsl:template>
</xsl:stylesheet>
