<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                exclude-result-prefixes="#default">

  <!-- =============================================================== -->
  <!-- breadcrumb.xsl (v001) -                                         -->
  <!-- Created 08.07.04 - even.halvorsen@usit.uio.no                   -->
  <!-- =============================================================== -->

  <!-- =============================================================== -->
  <!-- Document types that uses this breadcrumb must import            -->
  <!-- api-v001.xsl.                                                   -->
  <!-- =============================================================== -->

  <xsl:import href="translations-v001.xsl" />

  <xsl:template name="prefixed-breadcrumb">  
    <xsl:variable name="breadcrumb-class">
      <xsl:choose>
        <xsl:when test="$contentLanguage='en'">
          <xsl:value-of select="'breadcrumb-xsl breadcrumb-english'" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="'breadcrumb-xsl'" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

    <div class="{$breadcrumb-class}">    
    <xsl:call-template name="translate-phrase">
      <xsl:with-param name="identifier" select="'breadcrumb.introtext'"/>
    </xsl:call-template>&#160;<xsl:call-template name="breadcrumb" />
    </div>
  </xsl:template>

  <xsl:template name="breadcrumb">  
    <xsl:for-each select="$pathElements/*">
      <xsl:variable name="url" select="@URL" />
      <xsl:choose>
        <xsl:when test="$url = ''">
      <xsl:choose>
        <xsl:when test="@title = '/'">
          <xsl:value-of select="'Toppen'" />&#160;>&#32;
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="@title" />&#160;>&#32;  
        </xsl:otherwise>
      </xsl:choose>       

        </xsl:when>
        <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="@title = '/'">
          <a href="{@URL}"><xsl:value-of select="'Toppen'" /></a>&#160;>&#32;
        </xsl:when>
        <xsl:otherwise>
          <a href="{@URL}"><xsl:value-of select="@title" /></a>&#160;>&#32;  
        </xsl:otherwise>
      </xsl:choose>       

        </xsl:otherwise>
      </xsl:choose>       
        
    </xsl:for-each>  
  </xsl:template>

</xsl:stylesheet>
