<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:variable name="project" select="//buildproject/text()"/>
<xsl:variable name="label" select="//buildlabel/text()" />
	
	<xsl:output method="html" />
	
	<xsl:template match="/">
		<style type="text/css">
		<![CDATA[
	  #NDepend-report { font-family: Trebuchet MS; font-size: 10pt; }
      #NDepend-report TD { font-family: Trebuchet MS; font-size: 10pt; }
      #NDepend-report .title { font-size: 25pt; font-weight: bold; }
      #NDepend-report .subtitle { color: #883333; font-size: 20pt; font-weight: bold; background-color: #CCCCCC }
      #NDepend-report .subtitleref { color: blue; font-size: 10pt }
      #NDepend-report .info {color: black; font-size: 10pt}
      #NDepend-report .biginfo {color: black; font-size: 12pt ; font-weight: bold}
      #NDepend-report .infobold {color: black; font-size: 10pt ; font-weight: bold}
      #NDepend-report .hdrcell_left  { color: #FFFFFF ; font-weight: bold; background-color: #B3B3B3; text-align: left;}
      #NDepend-report .hdrcell_leftb  { color: #FFFFFF ; font-weight: bold; background-color: #939393; text-align: left;}
      #NDepend-report .hdrcell_right { color: #FFFFFF ; font-weight: bold; background-color: #B3B3B3; text-align: right;}
      #NDepend-report .hdrcell_rightb { color: #FFFFFF ; font-weight: bold; background-color: #939393; text-align: right;}
      #NDepend-report .datacell_left0 { color: #000055; background-color: #DBDBDB; text-align: left; }
      #NDepend-report .datacell_leftb0{ color: #000055; background-color: #BBBBBB; text-align: left; }
      #NDepend-report .datacell_right0{ color: #000055; background-color: #DBDBDB; text-align: right; }
      #NDepend-report .datacell_rightb0{ color: #000055; background-color: #BBBBBB; text-align: right; }
      #NDepend-report .datacell_red0 { color: #000055; background-color: #FFBBBB; text-align: right; }
      #NDepend-report .datacell_left1 { color: #000055; background-color: #EAEAEA; text-align: left; }
      #NDepend-report .datacell_leftb1 { color: #000055; background-color: #CACACA; text-align: left; }
      #NDepend-report .datacell_right1{ color: #000055; background-color: #EAEAEA; text-align: right; }
      #NDepend-report .datacell_rightb1{ color: #000055; background-color: #CACACA; text-align: right; }
      #NDepend-report .datacell_red1 { color: #000055; background-color: #FFCCCC; text-align: right; }
		]]>
		</style>
		
		<div id="NDepend-report">
			<xsl:apply-templates select="//NDepend" />
		</div>
		
	</xsl:template>

	<xsl:template match="NDepend">
		<div class="title">NDepend Report</div>
		<p></p>
		<xsl:apply-templates select="ReportInfo" />
		<div class="biginfo">To get explanations concerning these metrics, go to the <A HREF="http://smacchia.chez.tiscali.fr/NDepend.html" target="_blank">NDepend home page.</A></div>
		<p></p>
		<div class="subtitle">Types Dependencies</div>
		<p></p>
		<xsl:apply-templates select="TypeReferencement" />
		<p></p>
	</xsl:template>

	<xsl:template match="ReportInfo">
		<div class="biginfo">Application name: <font color="#FF0000"><xsl:value-of select="@AppName"/></font> </div>
		<div class="biginfo">This report has been built on: <font color="#FF0000"><xsl:value-of select="@NDependDate"/></font> </div>		
    </xsl:template>

   <xsl:template match="TypeReferencement">
        <table border="1" cellpadding="3" cellspacing="0" bordercolor="white">
            <tr>
                <td class="hdrcell_left">Type</td>
                <td class="hdrcell_left">Uses...</td>
                <td class="hdrcell_left">Is used by...</td>
            </tr>
			<xsl:apply-templates select="Type" />
        </table>
        <p></p>
    </xsl:template>
    
    <xsl:template match="Type">
        <tr>
			<td class="datacell_left{position() mod 2}">
				<xsl:element name="a">
					<xsl:attribute name="Name">
						<xsl:value-of select="@Name"/>
					</xsl:attribute>
					<xsl:value-of select="@Name"/> 
				</xsl:element>
			</td>
			
			<td class="datacell_left{position() mod 2}">
			<xsl:choose>
			<xsl:when test="Use"><xsl:apply-templates select="Use" /></xsl:when>
			<xsl:otherwise> - </xsl:otherwise>
			</xsl:choose>
			</td>
	        
			<td class="datacell_left{position() mod 2}">
			<xsl:choose>
			<xsl:when test="UsedBy"><xsl:apply-templates select="UsedBy" /></xsl:when>
			<xsl:otherwise> - </xsl:otherwise>
			</xsl:choose>
			</td>
        </tr>
    </xsl:template>
    
    <xsl:template match="UsedBy">
         <xsl:for-each select="Name">
			<xsl:element name="a">
				<xsl:attribute name="href">
					#<xsl:apply-templates/>
				</xsl:attribute>
				<xsl:apply-templates/>
			</xsl:element> ; 
         </xsl:for-each>
    </xsl:template>
    
    <xsl:template match="Use">
         <xsl:for-each select="Name">
			<xsl:element name="a">
				<xsl:attribute name="href">
					#<xsl:apply-templates/>
				</xsl:attribute>
				<xsl:apply-templates/>
			</xsl:element> ; 
         </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>