<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:i="http://bogusnamespace.com/inference_pilot_evaluation/annotation">

<!-- XSLT for XML to HTML developed for the AQUAINT KB Eval Pilot -->
<!-- Developed by Chris Manning and Teg Grenager, Aug 2005 -->

<xsl:output method="html" version="4.01"/>

<xsl:template match="/">
<html>
<head>
<title><xsl:text>AQUAINT KB Eval Pilot Data</xsl:text></title>
</head>
<body bgcolor="white" link="blue" vlink="red">
<h1><xsl:text>AQUAINT KB Eval Pilot Data</xsl:text></h1>
<xsl:if test="i:root/i:inference">
  <h2><span style="color: #00a000">Index</span></h2>
  <p>| <xsl:apply-templates select="i:root/i:inference" mode="number"/></p>
</xsl:if>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="i:root">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="i:inference" mode="number">
<xsl:variable name="number"><xsl:number/></xsl:variable>
<a><xsl:attribute name="href">#inf<xsl:value-of select="$number"/></xsl:attribute>
<xsl:value-of select="$number"/>: <xsl:value-of select="@id"/></a><xsl:text> | </xsl:text>
</xsl:template>

<xsl:template match="i:inference">
  <xsl:variable name="number"><xsl:number/></xsl:variable>
  <h2><span style="color: #00a000"><a><xsl:attribute name="name">inf<xsl:value-of select="$number"/></xsl:attribute>
  <xsl:text>Inference #</xsl:text><xsl:value-of select="$number"/>
  <xsl:text>; ID: </xsl:text><xsl:value-of select="@id"/></a></span></h2>
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="i:passage">
  <p><b>Passage: </b>
  <xsl:apply-templates/>
  </p>
</xsl:template>

<xsl:template match="i:hypothesis">
  <p><b>Hypothesis: </b>
  <xsl:apply-templates/>
  </p>
</xsl:template>

<xsl:template match="i:question">
  <p><b>Question: </b>
  <xsl:apply-templates/>
  </p>
</xsl:template>

<xsl:template match="i:provenance">
  <blockquote><span style="color: #606060"><i>Provenance: </i>
  <xsl:apply-templates/></span>
  </blockquote>
</xsl:template>

<xsl:template match="i:answer">
  <p><i>Answer #<xsl:value-of select="@id"/>: </i>
  <xsl:apply-templates select="i:response"/>
  <i>; Polarity: </i><xsl:value-of select="@polarity"/>;
  <i>Force: </i><xsl:value-of select="@force"/>;
  <i>Source: </i><xsl:value-of select="@source"/>
  <xsl:apply-templates select="i:because|i:comment"/>
  </p>
</xsl:template>

<xsl:template match="i:response">
  <span style="color: #006000"><b><xsl:apply-templates/></b></span>
</xsl:template>

<xsl:template match="i:because">
  <br/><span style="color: #606060"><i>Because: </i><xsl:apply-templates/></span>
</xsl:template>

<xsl:template match="i:comment">
  <br/><span style="color: #606060"><i>Comment: </i><xsl:apply-templates/></span>
</xsl:template>

</xsl:stylesheet>

