<?xml version="1.0" encoding="UTF-8"?>
<!-- bindxml_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="iidurl">http://bind.ca/Action?idsearch=bindid:</xsl:param>
<xsl:param name="giurl">http://bind.ca/Action?idsearch=gi:</xsl:param>
<xsl:param name="fbidurl">/cgi-bin/fbidq.html?</xsl:param>
<xsl:param name="urlbase">lookup?url=</xsl:param>
<xsl:param name="pubmedurl">http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=PubMed&amp;dopt=Abstract&amp;tool=FlyBase&amp;list_uids=</xsl:param>
<xsl:variable name="iid" select="//Interaction-id/text()"/>

<xsl:template match="/">
	<html>
	<head>
	<title>BIND Interaction <xsl:value-of select="$iid"/> </title>
	</head>
	<body id="body">
  <xsl:apply-templates/>
	</body>
	</html>
</xsl:template>

<xsl:template match="BIND-Interaction">
	<h2 align="left"> 
  <a href="{$iidurl}{$iid}">BIND Interaction</a> for 
  <xsl:value-of select="BIND-Interaction_a/BIND-object/BIND-object_short-label"/>
  and
  <xsl:value-of select="BIND-Interaction_b/BIND-object/BIND-object_short-label"/>
  </h2>
  <xsl:apply-templates/>
  <br/>
</xsl:template>

<xsl:template  priority="9" match="Geninfo-id">
  <p><b><xsl:value-of select="name()"/></b> :
  <a href="{$giurl}{text()}"><xsl:apply-templates/></a> 
  <xsl:value-of select="'&nbsp;'"/></p>
</xsl:template>
<!--
    <BIND-id_gi>
      <Geninfo-id>17352483</Geninfo-id>
    </BIND-id_gi>
-->

<xsl:template  priority="9" match="Interaction-id">
  <p><b><xsl:value-of select="name()"/></b> :
  <a href="{$iidurl}{text()}"><xsl:apply-templates/></a> 
  <xsl:value-of select="'&nbsp;'"/></p>
</xsl:template>


<!--
<xsl:template  priority="9" match="Object-id_str">
  <p><b><xsl:value-of select="name()"/></b> :
  <a href="{$fbidurl}{text()}"><xsl:apply-templates/></a> 
  <xsl:value-of select="'&nbsp;'"/></p>
</xsl:template>
-->

<xsl:template  priority="9" match="Seq-id_general">
  <xsl:variable name="id" select="Dbtag/Dbtag_tag/Object-id/Object-id_str/text()"/>
  <xsl:variable name="id2" select="Dbtag/Dbtag_tag/Object-id/Object-id_id/text()"/>
  <xsl:variable name="db" select="Dbtag/Dbtag_db/text()"/>
  <b>Seq-id </b> <xsl:value-of select="$db"/> : 
  <a href="{$fbidurl}{$id}"><xsl:value-of select="$id"/></a> 
  <xsl:value-of select="'&nbsp;'"/>
</xsl:template>

<xsl:template  priority="7" match="Dbtag">
  <xsl:variable name="id" select="Dbtag_tag/Object-id/Object-id_str/text()"/>
  <xsl:variable name="id2" select="Dbtag_tag/Object-id/Object-id_id/text()"/>
  <xsl:variable name="db" select="Dbtag_db/text()"/>
  <b><xsl:value-of select="$db"/></b>:
   <xsl:choose>
   <xsl:when test="string-length(id) > 0">
    <xsl:value-of select="$id"/>
   </xsl:when>
   <xsl:otherwise>
    <xsl:value-of select="$id2"/>
   </xsl:otherwise>
  </xsl:choose>
  <xsl:value-of select="'&nbsp;'"/>
</xsl:template>

<!--
    <Seq-id>
      <Seq-id_general>
        <Dbtag>
          <Dbtag_db>Flybase</Dbtag_db>
          <Dbtag_tag>
            <Object-id>
              <Object-id_str>FBgn0011648</Object-id_str>
            </Object-id>
          </Dbtag_tag>
        </Dbtag>
      </Seq-id_general>
    </Seq-id>

  <Org-ref_db>
    <Dbtag>
      <Dbtag_db>taxon</Dbtag_db>
      <Dbtag_tag>
        <Object-id>
          <Object-id_id>7227</Object-id_id>
        </Object-id>
      </Dbtag_tag>
    </Dbtag>
  </Org-ref_db>
-->

<xsl:template  priority="9" match="PubMedId">
  <b><xsl:value-of select="name()"/></b> :
  <a href="{$pubmedurl}{text()}"><xsl:apply-templates/></a> 
  <xsl:value-of select="'&nbsp;'"/>
</xsl:template>

<xsl:template  priority="8" match="BIND-descr">
  <p> <xsl:apply-templates/> </p>
</xsl:template>

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

<xsl:template  priority="1" match="BIND-descr_simple-descr">
  <p> <b><xsl:value-of select="name()"/></b> :
  <xsl:apply-templates/> </p>
</xsl:template>

<xsl:template  priority="9" match="BIND-object_other-names">
  <p> <b><xsl:value-of select="name()"/></b> :
  <xsl:apply-templates/> </p>
</xsl:template>


<xsl:template priority="7" match="BIND-Interaction/*/*">
  <b><xsl:value-of select="name()"/></b> :
  <xsl:apply-templates/><br/>
</xsl:template>
<xsl:template priority="8" match="BIND-Interaction_a">
  <b>Molecule A</b><xsl:apply-templates/><hr/>
</xsl:template>
<xsl:template priority="8" match="BIND-Interaction_b">
  <b>Molecule B</b><xsl:apply-templates/><hr/>
</xsl:template>


<!-- skip these -->
<xsl:template  priority="9" match="BIND-id_di|BIND-Interaction_authors|BIND-Interaction_updates">
</xsl:template>

</xsl:stylesheet>
