<?xml version="1.0" encoding="UTF-8"?>

<!-- blastxml_report.xsl -->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp   "&#160;">
]>

<xsl:stylesheet version="1.1" 
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
   xmlns:java="http://xml.apache.org/xalan/java"
   exclude-result-prefixes="java" 
   > 

<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>

<xsl:param name="fbidurl">/cgi-bin/fbidq.html?</xsl:param>
<xsl:param name="urlbase">lookup?url=</xsl:param>

<xsl:template match="/">
	<html>
	<head>
	<title>BLAST Hits</title>
	</head>
	<body id="body">
  <xsl:apply-templates/>
	</body>
	</html>
</xsl:template>

<xsl:template match="Hit">
	<h2 align="left"> 
  BLAST Hit 
  </h2>
  <xsl:apply-templates/>
  <br/>
</xsl:template>

<xsl:template match="Hit/*">
  <b><xsl:value-of select="name()"/></b> :
  <xsl:apply-templates/> <br/>
</xsl:template>


<xsl:template priority="9" match="Hit_hsps">
  <hr/>
  <table cellpadding="4" cellspacing="0">
  <xsl:call-template name="hspheader" />
  <xsl:apply-templates/>      
  </table>

  <xsl:apply-templates mode="align" />
</xsl:template>

<xsl:template name="hspheader">
  <tr bgcolor="#EEEEEE"> 
  <th align="right" bgcolor="#DODODO" >#</th>
  
  <th bgcolor="#DODODO" align="right">Identity</th>
  <th bgcolor="#DODODO" align="right">Align-len</th>
  
  <th bgcolor="#DODODO" align="right">Query-range</th>
  <th bgcolor="#DODODO" align="right">Hit-range</th>

  <th bgcolor="#DODODO" align="right">E-value</th>
  <th bgcolor="#DODODO" align="right">Bit-score</th>
  </tr>
</xsl:template>

<xsl:template match="Hsp">
  <tr valign="top"> 
  <td bgcolor="white" align="right"><xsl:value-of select="Hsp_num" /></td>

  <td bgcolor="white" align="right"><xsl:apply-templates select="Hsp_identity"/></td>      
  <td bgcolor="white" align="right"><xsl:apply-templates select="Hsp_align-len"/></td>      

  <td bgcolor="white" align="right">
  <xsl:apply-templates select="Hsp_query-from"/> .. 
  <xsl:apply-templates select="Hsp_query-to"/>
  </td>
  
  <td bgcolor="white" align="right">
  <xsl:apply-templates select="Hsp_hit-from"/> .. 
  <xsl:apply-templates select="Hsp_hit-to"/>
  </td>      

  <td bgcolor="white" align="right"><xsl:apply-templates select="Hsp_evalue"/></td>      
  <td bgcolor="white" align="right"><xsl:apply-templates select="Hsp_bit-score"/></td>      

  </tr>
<xsl:text>
</xsl:text>
</xsl:template>

<xsl:template mode="align" match="Hsp">
  Alignment #<xsl:value-of select="Hsp_num" />
  <pre><xsl:value-of select="Hsp_qseq/text()"/><br/>
  <xsl:value-of select="Hsp_midline/text()"/><br/>
  <xsl:value-of select="Hsp_hseq/text()"/></pre>
</xsl:template>

<!--
  <tr><td colspan="8">
  </td></tr>

// make into table
<Hsp_num>1</Hsp_num>
<Hsp_bit-score>243.047</Hsp_bit-score>
<Hsp_score>619</Hsp_score>
<Hsp_evalue>1.3385e-62</Hsp_evalue>
<Hsp_query-from>50405</Hsp_query-from>
<Hsp_query-to>51076</Hsp_query-to>
<Hsp_hit-from>175</Hsp_hit-from>
<Hsp_hit-to>377</Hsp_hit-to>
<Hsp_query-frame>-1</Hsp_query-frame>
<Hsp_identity>121</Hsp_identity>
<Hsp_positive>157</Hsp_positive>
<Hsp_align-len>224</Hsp_align-len>

-->



<!--
<xsl:template priority="7" match="Hsp_qseq|Hsp_hseq|Hsp_midline">
<xsl:value-of select="name()"/><pre><xsl:apply-templates/></pre>
</xsl:template>
-->


<!-- skip these -->
<xsl:template  priority="9" match="Hit_num|Hit_accession">
</xsl:template>

</xsl:stylesheet>

