﻿<?xml version="1.0" encoding="UTF-8" ?>
<!-- (C) 2003 Dirk Röckmann www.nt-text.net -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html"/>

<xsl:strip-space elements="book"/>

<xsl:template match="book">
  <html>
  <xsl:comment>
      REVISED AMHARIC BIBLE IN XML (2003)
      PRINTED VERSION BY UNITED BIBLE SOCIETIES (C)1962
      E-TEXT IN TRANSLITERATED ASCII FORMAT BY LAPSLEY/BROOKS FOUNDATION 1994
      UNICODE UTF-8 TRANSFORMATION AND XML-TAGGING BY DIRK RÖCKMANN 2003 (WWW.NT-TEXT.NET)
      WITH KIND PERMISSION OF THE BIBLE SOCIETY OF ETHIOPIA
      EVERY NON-COMMERCIAL WORK USING THIS DATA IN ANY FORM MUST FULLY INCLUDE THIS COPYRIGHT STATEMENT!
      EVERY COMMERCIAL USE OF PARTS OR THE COMPLETE DATA IN ANY FORM NEEDS WRITTEN PERMISSION OF THE BIBLE SOCIETY OF ETHIOPIA!
  </xsl:comment>
  <body>
  <h2><xsl:value-of select="@title"/> (<xsl:value-of select="@atitle"/>)</h2>
  <br/>
  <xsl:apply-templates select="chapter"/>
  </body>
  </html>
</xsl:template>

<xsl:template match="chapter">
  <h2><xsl:value-of select="@num"/></h2>
  <xsl:apply-templates select="verse"/>
</xsl:template>

<xsl:template match="verse">
  <xsl:variable name="verse_anchor" select="concat(../@num,'_',@num)"/>
  <h3>
  <a name="{$verse_anchor}"><xsl:value-of select="@num"/></a>
  <xsl:text> </xsl:text>
  <xsl:for-each select="*">
    <xsl:choose>
      <xsl:when test="name() = 'word'">
        <xsl:variable name="word_anchor" select="concat(../../@num,'_',../@num,'_',@num)"/>
        <a href="conc.htm#{$word_anchor}"><xsl:value-of select="."/></a>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="."/>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:text> </xsl:text>    
  </xsl:for-each>
  </h3>

</xsl:template>

</xsl:stylesheet>
