<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:param name="current"/>

<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" encoding="ISO-8859-1"/>
<xsl:strip-space elements="*"/>

<xsl:variable name="englishdb" select="document('lfdb.en.xml')"/>
<xsl:variable name="persondb" select="document('lfdb.persons.xml')"/>
<xsl:variable name="db" select="/"/>

<xsl:variable name="version" select="0.1"/>

<xsl:template match="/">
  <p>
  <center><h3>De Artikelen</h3></center>
  <b>Vertaald</b>
  <ul>
  <xsl:for-each select="$englishdb/database/articles//article[issue/@href=$current]">
    <xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
    <xsl:if test="$db/database/articles/article[@id=$id]/translation/finished">
      <xsl:if test="substring($id,1,3)!='cov'">
        <li type="circle"><img src="../../common/images/frame.gif" alt="point"
        align="middle"/>
          <xsl:element name="a">
            <xsl:choose>
              <xsl:when test="$db/database/articles/article[@id=$id]/file[@xml:lang='nl']">
                <xsl:attribute name="href"><xsl:text>../../</xsl:text>
                  <xsl:value-of select="$db/database/articles/article[@id=$id]/file[@xml:lang='nl']"/>
                </xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="href">article<xsl:value-of select="$id"/>.shtml</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:value-of select="$db/database/articles/article[@id=$id]/title[@xml:lang='nl']"/>
          </xsl:element>,
          <xsl:for-each select="person">
            <xsl:variable name="pid"><xsl:value-of select="@href"/></xsl:variable>
            <xsl:value-of select="$persondb/database/persons/person[@id=$pid]/name"/>, 
          </xsl:for-each>
          <br/><xsl:value-of select="$db/database/articles/article[@id=$id]/abstract[@xml:lang='nl']"/>
        </li>
      </xsl:if>
    </xsl:if>
  </xsl:for-each>
  </ul>
  <p/><b>Onvertaald</b><ul>
  <xsl:for-each select="$englishdb/database/articles//article[issue/@href=$current]">
    <xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
    <xsl:if test="not($db/database/articles/article[@id=$id]/translation/finished)">
      <xsl:if test="substring($id,1,3)!='cov'">
        <li type="circle"><img src="../../common/images/frame.gif" alt="point"
        align="middle"/>
          <xsl:element name="a">
            <xsl:choose>
              <xsl:when test="$db/database/articles/article[@id=$id]/file[@xml:lang='nl']">
                <xsl:attribute name="href"><xsl:text>../../</xsl:text>
                  <xsl:value-of select="$db/database/articles/article[@id=$id]/file[@xml:lang='nl']"/>
                </xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="href">
                  <xsl:text>../../English/</xsl:text>
                  <xsl:value-of select="$current"/>
                  <xsl:text>/article</xsl:text>
                  <xsl:value-of select="$id"/>
                  <xsl:text>.shtml</xsl:text>
                </xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:value-of select="title"/>
          </xsl:element>,
          <xsl:for-each select="person">
            <xsl:variable name="pid"><xsl:value-of select="@href"/></xsl:variable>
            <xsl:value-of select="$persondb/database/persons/person[@id=$pid]/name"/>, 
          </xsl:for-each>
          <br/><xsl:value-of select="abstract"/>
        </li>
      </xsl:if>
    </xsl:if>
  </xsl:for-each>
  </ul>
  </p>
</xsl:template>

</xsl:stylesheet>
