<?xml version="1.0"?>
<xsl:stylesheet
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:bib="http://joachim-breitner.de/2004/Website/Bibliography"
  version="1.0"
>

<!-- This file is © 2004 Joachim Breitner. All Rights Reserved, but feel free to ask for a Free Licence (MIT, GPL): mail@joachim-breitner.de -->

<!--
<xsl:output method="xml"
  media-type="text/html"
  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
/>
-->

<xsl:template match="bib:bibliography">
 <ul class="bibliography">
  <xsl:apply-templates/>
 </ul>
</xsl:template>

<xsl:template match="bib:bibentry">
 <li>
  <xsl:choose>
   <xsl:when test="@type = 'diplomathesis'">
    <xsl:value-of select="$lang.diplomathesis"/>:
   </xsl:when>
   <xsl:when test="@type = 'studentresearchproject'">
    <xsl:value-of select="$lang.studentresearchproject"/>:
   </xsl:when>
   <xsl:when test="@type = 'magazine'">
    <xsl:value-of select="$lang.magazine"/>:
   </xsl:when>
   <xsl:when test="@type = 'talk'">
    <xsl:value-of select="$lang.talk"/>:
   </xsl:when>
   <xsl:when test="@type = 'paper'">
    <xsl:value-of select="$lang.paper"/>:
   </xsl:when>
  </xsl:choose>
  <xsl:apply-templates select="*"/>
 </li>
</xsl:template>

<xsl:template match="bib:sub">
 <sub><xsl:apply-templates /></sub>
</xsl:template>

<xsl:template match="bib:title">
 <strong><xsl:apply-templates /></strong>
</xsl:template>

<xsl:template match="bib:subtitle">,
 <em><xsl:apply-templates /></em>
</xsl:template>

<xsl:template match="bib:coauthors">,
 with <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:year">,
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:date">,
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:event">,
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:place">,
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:school">,
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:journal">,
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:issue">,
 <xsl:value-of select="$lang.issue"/>
 <xsl:text> </xsl:text>
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:volume">,
 <xsl:value-of select="$lang.volume"/>
 <xsl:text> </xsl:text>
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:pages">,
 <xsl:choose>
  <xsl:when test="string(number(.))='NaN'">
   <xsl:value-of select="$lang.pages"/>
  </xsl:when>
  <xsl:otherwise>
   <xsl:value-of select="$lang.page"/>
  </xsl:otherwise>
 </xsl:choose>
 <xsl:text> </xsl:text>
 <xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:references">
<br/>
<xsl:apply-templates />
</xsl:template>

<xsl:template match="bib:pdf-file">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.pdfFile"/>
 </a>
</xsl:template>

<xsl:template match="bib:latex-file">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.latexSource"/>
 </a>
</xsl:template>

<xsl:template match="bib:blog-entry">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.blogEntry"/>
 </a>
</xsl:template>

<xsl:template match="bib:video-stream">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.videoStream"/>
 </a>
</xsl:template>

<xsl:template match="bib:online-article">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.onlineArticle"/>
 </a>
</xsl:template>

<xsl:template match="bib:event-program">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.eventProgram"/>
 </a>
</xsl:template>

<xsl:template match="bib:arxiv">
 <xsl:value-of select="$lang.preprint"/><xsl:text>: </xsl:text>
 <a>
  <xsl:attribute name="href">http://arxiv.org/abs/<xsl:value-of select="." /></xsl:attribute>
  arXiv:<xsl:value-of select="." />
 </a>
</xsl:template>

<xsl:template match="bib:doi">
  <xsl:value-of select="$lang.doi"/><xsl:text>: </xsl:text>
 <a>
  <xsl:attribute name="href">http://dx.doi.org/<xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="." />
 </a>
</xsl:template>

<xsl:template match="bib:journal-page">
 <a>
  <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  <xsl:value-of select="$lang.journalPage"/>
 </a>
</xsl:template>


</xsl:stylesheet>
