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

  <!-- =============================================================== -->
  <!--  slideshow.xsl (v001)                                           -->
  <!--  opprettet 19.04.07 - kristian.syversen@usit.uio.no             -->
  <!-- =============================================================== -->
  
  <!-- prefixes (text element definitions) -->
  <xsl:import href="slideshow-translations.xsl" />
  
  <xsl:import href="../../../system/api-v001.xsl" />
  
  <xsl:import href="../../../common/components/structuredtext/v002/structuredtext.xsl" />
  <xsl:import href="../../../common/components/heading/v002/heading.xsl" />
  <xsl:import href="../../../common/components/image/v002/image.xsl" />
  <xsl:import href="../../../common/components/photo/v001/photo.xsl" />
  <xsl:import href="../../../common/components/weblink/v001/weblink.xsl" />
  
  <xsl:import href="../../../felles/ressurser/url-tools-v001.xsl" />
  
  <!-- overstyrer output controller i.f.t. Apollon fordi Design-byrå for MUV, Gazette, leverer XHTML Transitional -->
  <xsl:output
    method="xml"
    media-type="text/html"
    omit-xml-declaration="no"
    encoding="utf-8"
    indent="yes"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
  
  
  <xsl:strip-space elements="*"/>
  
  
  <xsl:template match="/">
    <html>
      <head>
        <title>
          <xsl:call-template name="slideshow-phrase">
            <xsl:with-param name="identifier" select="'slideshow.slideshow'"/>
          </xsl:call-template>
          - "<xsl:value-of select="//heading"/>"
        </title>
      </head>
      <body>
        <xsl:apply-templates />
        
        <!-- TESTDATA for utskrift av 'relatert-stoff'-innhold (ikke endelig avklart hvordan dette skal vises) -->
        <div class="relatert-stoff">
          <ul>
            <li>
              <p>
                <b>"Relatert stoff" kan bestå av fritekst- og weblenke-komponenter (som demonstrert her)</b>
              </p>
            </li>
            <li>
              <a href="http://www.admin.uio.no/prosjekter/muv/">MUV - Gamle sider</a>
            </li>
            <li>
              <p>Artikkel-avsnitt <b>(fritekst)</b> (fritt antall)</p>        
            </li>
            <li>
              <a href="http://www.uio.no">UiO</a>
            </li>
          </ul>
        </div>
      </body>
    </html>
  </xsl:template>
  
  
  <xsl:template match="slideshow">
    <xsl:apply-templates select="heading" />
    <xsl:call-template name="navigation" />
    <div class="{name()}">
      <xsl:for-each select="./slide">
        <div class="{name()}">
          <xsl:apply-templates />
        </div>
      </xsl:for-each>
    </div>  
  </xsl:template>
  
  
  <!-- Helper template for picture navigation elements -->
  <xsl:template name="navigation">
    <div class="navigation">
      <div class="counter">
        <xsl:call-template name="slideshow-phrase">
          <xsl:with-param name="identifier" select="'slideshow.picture-number'"/>
        </xsl:call-template> 
        2 <!-- statisk!!! -->
        <xsl:call-template name="slideshow-phrase">
          <xsl:with-param name="identifier" select="'slideshow.of'"/>
        </xsl:call-template>
        3 <!-- statisk!!! -->
      </div>
      <div class="previous-pointer">
        <a href="previous.jpg">
          <xsl:call-template name="slideshow-phrase">
          <xsl:with-param name="identifier" select="'slideshow.previous'"/>
          </xsl:call-template>
        </a>
      </div>
      <div class="next-pointer">
        <a href="previous.jpg">
          <xsl:call-template name="slideshow-phrase">
          <xsl:with-param name="identifier" select="'slideshow.next'"/>
          </xsl:call-template>
        </a>
      </div>
    </div>
  </xsl:template>
  
      
  <xsl:template match="relatert-stoff">
    <div class="relatert-stoff">
      <p>
        <b>Relatert stoff:</b>
      </p>
      <xsl:if test="node()[normalize-space(.)]">
        <ul>
          <xsl:for-each select="node()">
            <li> <xsl:apply-templates select="." /> </li>
          </xsl:for-each>
        </ul>
      </xsl:if>
    </div>
  </xsl:template>
  
</xsl:stylesheet>
