<?xml version="1.0" encoding="UTF-8"?>

<!-- 
    Project: Moralische Wochenschriften, Institut für Romanistik
    Company: ZIM:IG (Zentrum für Informationsmodellierung in den Geisteswissenschaften)
    Author: Martina Semlak
    Last update: 08-08-2012   
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:bibtex="http://bibtexml.sf.net/" xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1" xmlns:t="http://www.tei-c.org/ns/1.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
    exclude-result-prefixes="bibtex s t dc oai_dc">
    
    <xsl:output method="xml" doctype-system="about:legacy-compat" encoding="UTF-8" indent="yes"/>

    <xsl:include href="3mws-static.xsl"/>

    <xsl:template name="content">
        <xsl:choose>
            <xsl:when test="$cid='context:mws'">
                <section class="ym-grid linearize-level-1 ym-equalize">
                    <article class="ym-g66 ym-gl content">
                        <div class="ym-gbox-left ym-clearfix" style="min-height: 30em;">
                            <!-- FIXME: eventuell XML-Struktur der statischen Inhalte umstellen (Dublin Core raus, div1 durch div ersetzen, Schema erstellen -->
                            <xsl:choose>
                                <xsl:when test="$mode='about'">
                                    <xsl:apply-templates
                                        select="document(concat('/archive/get/', $cid, '/ABOUT'))//t:TEI/t:text/t:body"
                                        mode="staticContent"/>
                                </xsl:when>
                                <xsl:when test="$mode='imprint'">
                                    <xsl:apply-templates
                                        select="document(concat('/archive/get/', $cid, '/IMPRINT'))//t:TEI/t:text/t:body"
                                        mode="staticContent"/>
                                </xsl:when>
                                <xsl:when test="$mode='help' or $mode='search'">
                                    <xsl:apply-templates
                                        select="document(concat('/archive/get/', $cid, '/HELP'))//t:TEI/t:text/t:body"
                                        mode="staticContent"/>
                                </xsl:when>
                                <xsl:when test="$mode='register'">
                                    <xsl:apply-templates
                                        select="document(concat('/archive/get/', $cid, '/REGISTER'))//register"
                                        />
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:apply-templates
                                        select="document(concat('/archive/get/', $cid, '/INTRO'))//t:TEI/t:text/t:body"
                                        mode="staticContent"/>
                                </xsl:otherwise>
                            </xsl:choose>
                        </div>
                    </article>
                    <xsl:choose>
                        <xsl:when test="$mode='help' or $mode='search' or $mode='register'">
                            <aside class="ym-g33 ym-gr" style="overflow: hidden;" >
                                
                                <div class="ym-gbox-right ym-clearfix">
                                
                            <h6 style="font-family: arial, verdana, helvetica, sans-serif; padding-bottom: 1em;"><i18n:text>Advanced search</i18n:text></h6>
                            
                                    <form action="/search/gsearch" method="get" name="g3search">   
                                <!--    <p>
                                    <select id="dc.language" name="dc.language" size="1" class="form-select">
                                    <xsl:for-each select="$form/form/languages/language">
                                    <option>
                                    <xsl:attribute name="value">
                                    <xsl:value-of select="value"/>		                                        			
                                    </xsl:attribute>
                                    <xsl:if test="value=''">
                                    <xsl:attribute name="selected">selected</xsl:attribute>		
                                    </xsl:if>
                                    <xsl:call-template name="optionValue" />
                                    </option>
                                    </xsl:for-each>                                            
                                    </select>    
                                    </p>         -->                              
                                
                                <p>
                                    <select id="dc.coverage" name="dc.coverage" size="1" class="form-select" style="width: 13em;">
                                        <xsl:for-each select="$form/form/coverages/coverage">
                                            <option>
                                                
                                                
                                                
                                                <xsl:attribute name="value">
                                                    <xsl:value-of select="value"/>		                                        			
                                                </xsl:attribute>
                                                
                                                <xsl:choose>
                                                    <xsl:when test="value = 'Spanien' and $context='es'">
                                                        <xsl:attribute name="selected">selected</xsl:attribute>
                                                    </xsl:when>
                                                    <xsl:when test="value = 'Italien' and $context='it'">
                                                        <xsl:attribute name="selected">selected</xsl:attribute>
                                                    </xsl:when>
                                                    <xsl:when test="value = 'Frankreich' and $context='fr'">
                                                        <xsl:attribute name="selected">selected</xsl:attribute>
                                                    </xsl:when>
                                                    <xsl:when test="value = ''">
                                                        <xsl:attribute name="selected">selected</xsl:attribute>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                                <!-- <xsl:if test="value=''">
                                                    <xsl:attribute name="selected">selected</xsl:attribute>		
                                                    </xsl:if> -->
                                                <xsl:call-template name="optionValue" />
                                            </option>
                                        </xsl:for-each>                                            
                                    </select>  
                                </p>
                                
                                <p>
                                    <select id="dc.subject" name="dc.subject"  style="width: 13em;" size="1" class="form-select"><!--  multiple="multiple" -->
                                        <xsl:for-each select="$form/form/subjects/subject">
                                            <option>
                                                <xsl:attribute name="value">
                                                    
                                                    <xsl:value-of select="value"/>		
                                                    
                                                </xsl:attribute>
                                                <xsl:if test="value=''">
                                                    
                                                    <xsl:attribute name="selected">selected</xsl:attribute>		
                                                </xsl:if>
                                                
                                                <xsl:call-template name="optionValue" />
                                            </option>
                                        </xsl:for-each>                                            
                                    </select>  
                                </p>
                                
                                <p>
                                    <select id="genre" name="genre" size="1" class="form-select"  style="width: 13em;">
                                        <xsl:for-each select="$form/form/genres/genre">
                                            <option>
                                                <xsl:attribute name="value">
                                                    <xsl:value-of select="value"/>		                                        			
                                                </xsl:attribute>
                                                <xsl:if test="value=''">
                                                    <xsl:attribute name="selected">selected</xsl:attribute>		
                                                </xsl:if>
                                                <xsl:call-template name="optionValue" />
                                            </option>
                                        </xsl:for-each>                                            
                                    </select>  
                                </p>
                                
                                <p>                                            
                                    <input id="date" name="date" type="text" size="30"  style="width: 13em;" class="form-input1" value="-- dates --" i18n:attr="value" onclick="this.select()"/>
                                </p>
                                
                                <p>
                                    <input id="query" name="query" size="30"  style="width: 13em;" type="text" class="form-input1" value="-- keyword --" i18n:attr="value" onclick="this.select()"/>
                                    
                                    <input type="hidden" name="hitPageSize" value="10"/>
                                    <input type="hidden" name="hitPageStart" value="1"/>
                                    <input type="hidden" name="pid" value="mws"/>
                                    <input type="hidden" name="search" value="advanced" />
                                    <input type="hidden" name="locale" value="{$locale}" />
                                    <input type="hidden" name="x2" value="http://gams.uni-graz.at/mws/3mws-search.xsl" />
                                    
                                    
                                    
                                </p>
                                
                                
                                <p class="submit">
                                    <button class="ym-button" type="submit" value="Suche" ><i18n:text>search</i18n:text></button><!-- class="button" -->
                                    <span><a href="/archive/objects/context:mws/methods/sdef:Context/get?mode=help&amp;locale={$locale}" class="ym-button"><i18n:text>Help</i18n:text></a></span>
                                </p>
                                
                                
                            </form>
                                </div>
                                </aside>
                        </xsl:when>
                        <xsl:otherwise>
                            <aside class="ym-g33 ym-gr">
                                <div class="ym-gbox-right ym-clearfix">
                                    
                                    <!-- FIXME: Text übersetzen lassen; Quick and Dirty!!! -->
                                    <ul>
                                        <li style="position: relative; z-index:2;">
                                            <a
                                                href="/archive/objects/context:mws/methods/sdef:Context/get?mode=about&amp;locale={$lang}">
                                                <i18n:text>Project description</i18n:text>
                                            </a>
                                        </li>
                                        <li style="position: relative; z-index:2;">
                                            <a
                                                href="/archive/objects/container:mws-bibliographie/methods/sdef:Context/get?locale={$lang}&amp;mode=bibl&amp;context=">
                                                <i18n:text>bibliography</i18n:text>
                                            </a>
                                        </li>
                                    </ul>
                                    <div>
                                    <img style="margin-top: 2em" src="/mws/img/karte.jpg" width="100%" alt="map"  />
                                    </div>
                                    
                                    <!-- <div>
                                        <div id="map-europe" style="z-index: 1;">
                                            <ul class="europe">
                                                <li class="eu13" style="text-transform: uppercase;">
                                                    <a
                                                        href="/archive/objects/container:mws-fr/methods/sdef:Context/get?locale={$lang}&amp;mode=&amp;context=fr">
                                                        <i18n:text>france</i18n:text>
                                                    </a>
                                                </li>
                                                <li class="eu22" style="text-transform: uppercase;">
                                                    <a
                                                        href="/archive/objects/container:mws-it/methods/sdef:Context/get?locale={$lang}&amp;mode=&amp;context=it">
                                                        <i18n:text>italy</i18n:text>
                                                    </a>
                                                </li>
                                                <li class="eu42" style="text-transform: uppercase;">
                                                    <a
                                                        href="/archive/objects/container:mws-es/methods/sdef:Context/get?locale={$lang}&amp;mode=&amp;context=es">
                                                        <i18n:text>spain</i18n:text>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    
                                    <p style="clear: both; position: relative; top: 20em; z-index: 2;"><i18n:text>Click to select a country</i18n:text></p>   -->
                                    
                                </div>
                            </aside>
                        </xsl:otherwise>
                    </xsl:choose>
                    
                </section>
            </xsl:when>

            <xsl:otherwise>
                <!-- FIXME: call-template einbauen und mit oberem Teil zusammenführen -->
                <section class="ym-grid linearize-level-1 ym-equalize">
                    <article class="ym-g66 ym-gl content">
                        <div class="ym-gbox-left ym-clearfix">
                            <div id="display" style="min-height: 30em;">
                              <!--<xsl:choose>
                              	<xsl:when test="$mode='register'">
                              	    
                              	    <xsl:apply-templates
                              	        select="document(concat('/archive/get/', $cid, '/REGISTER'))//register"
                              	        mode="staticContent"/>
                              	</xsl:when>
                              	<xsl:otherwise>-->
                              	    <h1 class="result">
                                    <i18n:text>
                                        <xsl:value-of
                                            select="s:sparql/s:results/s:result/s:container"/>
                                    </i18n:text>
                                </h1>
                                
                                <xsl:if test="$crelation">
                                	<p style="text-align: right;">
                                		<a>
                                		<xsl:attribute name="href">
                                			<xsl:value-of select="$crelation" />
                                		</xsl:attribute>
                                		 <i18n:text>external</i18n:text>
                                		</a>
                                	</p>
                               </xsl:if>
                                
                                <ul>
                                    <xsl:for-each select="s:sparql/s:results/s:result">
                                        <xsl:call-template name="createResults"/>
                                    </xsl:for-each>
                                </ul>
                                <!--</xsl:otherwise>
                              </xsl:choose>
                               -->
                            </div>
                        </div>
                    </article>
                    <aside class="ym-g33 ym-gr" style="overflow: hidden;" >
                        
                        <div class="ym-gbox-right ym-clearfix">
                            <xsl:choose>
                                <xsl:when test="$mode='imprint' or $mode='about' or $mode='bibl' or //bibtex:file">
                            <!-- FIXME: Text übersetzen lassen; syncheight einbauen, Quick and Dirty!!! -->
                            
                            <ul>
                                <li style="position: relative; z-index:2;">
                                    <a
                                        href="/archive/objects/context:mws/methods/sdef:Context/get?mode=about">
                                        <i18n:text>Project description</i18n:text>
                                    </a>
                                </li>
                                <li style="position: relative; z-index:2;">
                                    <a
                                        href="/archive/objects/container:mws-bibliographie/methods/sdef:Context/get?locale={$lang}&amp;mode=bibl&amp;context=">
                                        <i18n:text>bibliography</i18n:text>
                                    </a>
                                </li>
                            </ul>
                            <div>
                                <div id="map-europe" style="z-index: 1;">
                                    <ul class="europe">
                                        <li class="eu13" style="text-transform: uppercase;">
                                            <a
                                                href="/archive/objects/container:mws-fr/methods/sdef:Context/get?locale={$lang}&amp;mode=&amp;context=fr">
                                                <i18n:text>france</i18n:text>
                                            </a>
                                        </li>
                                        <li class="eu22" style="text-transform: uppercase;">
                                            <a
                                                href="/archive/objects/container:mws-it/methods/sdef:Context/get?locale={$lang}&amp;mode=&amp;context=it">
                                                <i18n:text>italy</i18n:text>
                                            </a>
                                        </li>
                                        <li class="eu42" style="text-transform: uppercase;">
                                            <a
                                                href="/archive/objects/container:mws-es/methods/sdef:Context/get?locale={$lang}&amp;mode=&amp;context=sp">
                                                <i18n:text>spain</i18n:text>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>

                                    <p style="clear: both; position: relative; top: 20em; z-index: 2;"
                                ><i18n:text>Click to select a country</i18n:text></p>
                                </xsl:when>
                                
                                
                                <xsl:otherwise>
                                    <h6 style="font-family: arial, verdana, helvetica, sans-serif; padding-bottom: 1em;"><i18n:text>Advanced search</i18n:text></h6>
                                    
                                    <form action="/search/gsearch" method="get" name="g3search">   
                                    <!--    <p>
                                            <select id="dc.language" name="dc.language" size="1" class="form-select">
                                                <xsl:for-each select="$form/form/languages/language">
                                                    <option>
                                                        <xsl:attribute name="value">
                                                            <xsl:value-of select="value"/>		                                        			
                                                        </xsl:attribute>
                                                        <xsl:if test="value=''">
                                                            <xsl:attribute name="selected">selected</xsl:attribute>		
                                                        </xsl:if>
                                                        <xsl:call-template name="optionValue" />
                                                    </option>
                                                </xsl:for-each>                                            
                                            </select>    
                                        </p>         -->                              
                                        
                                        <p>
                                            <select id="dc.coverage" name="dc.coverage"  style="width: 13em;" size="1" class="form-select">
                                                <xsl:for-each select="$form/form/coverages/coverage">
                                                    <option>
                                                        
                                                        
                                                           
                                                        <xsl:attribute name="value">
                                                            <xsl:value-of select="value"/>		                                        			
                                                        </xsl:attribute>
                                                        
                                                        <xsl:choose>
                                                        	<xsl:when test="value = 'Spanien' and $context='es'">
                                                        		<xsl:attribute name="selected">selected</xsl:attribute>
                                                        	</xsl:when>
                                                        	<xsl:when test="value = 'Italien' and $context='it'">
                                                        		<xsl:attribute name="selected">selected</xsl:attribute>
                                                        	</xsl:when>
                                                        	<xsl:when test="value = 'Frankreich' and $context='fr'">
                                                        		<xsl:attribute name="selected">selected</xsl:attribute>
                                                        	</xsl:when>
                                                        	<xsl:when test="value = ''">
                                                        		<xsl:attribute name="selected">selected</xsl:attribute>
                                                        	</xsl:when>
                                                        	<xsl:otherwise>
                                                        		
                                                        	</xsl:otherwise>
                                                        </xsl:choose>
                                                        <!-- <xsl:if test="value=''">
                                                            <xsl:attribute name="selected">selected</xsl:attribute>		
                                                        </xsl:if> -->
                                                        <xsl:call-template name="optionValue" />
                                                    </option>
                                                </xsl:for-each>                                            
                                            </select>  
                                        </p>
                                        
                                        <p>
                                            <select id="dc.subject" name="dc.subject" size="1"  style="width: 13em;" class="form-select">
                                                <xsl:for-each select="$form/form/subjects/subject">
                                                    <option>
                                                        <xsl:attribute name="value">
                                                            
                                                            <xsl:value-of select="value"/>		
                                                            
                                                        </xsl:attribute>
                                                        <xsl:if test="value=''">
                                                            
                                                            <xsl:attribute name="selected">selected</xsl:attribute>		
                                                        </xsl:if>
                                                        
                                                        <xsl:call-template name="optionValue" />
                                                    </option>
                                                </xsl:for-each>                                            
                                            </select>  
                                        </p>
                                        
                                        <p>
                                            <select id="genre" name="genre" size="1"  style="width: 13em;" class="form-select">
                                                <xsl:for-each select="$form/form/genres/genre">
                                                    <option>
                                                        <xsl:attribute name="value">
                                                            <xsl:value-of select="value"/>		                                        			
                                                        </xsl:attribute>
                                                        <xsl:if test="value=''">
                                                            <xsl:attribute name="selected">selected</xsl:attribute>		
                                                        </xsl:if>
                                                        <xsl:call-template name="optionValue" />
                                                    </option>
                                                </xsl:for-each>                                            
                                            </select>  
                                        </p>
                                        
                                        <p>                                            
                                            <input id="date" name="date" type="text" size="30"  style="width: 13em;" class="form-input1" value="-- dates --" i18n:attr="value" onclick="this.select()"/>
                                        </p>
                                        
                                        <p>
                                            <input id="query" name="query" size="30" type="text"  style="width: 13em;" class="form-input1" value="-- keyword --" i18n:attr="value" onclick="this.select()"/>
                                            
                                            <input type="hidden" name="hitPageSize" value="10"/>
                                            <input type="hidden" name="hitPageStart" value="1"/>
                                            <input type="hidden" name="pid" value="mws"/>
                                            <input type="hidden" name="search" value="advanced" />
                                           <input type="hidden" name="locale" value="{$locale}" />
                                            <input type="hidden" name="x2" value="http://gams.uni-graz.at/mws/3mws-search.xsl" />
                                            
                                           
                                           
                                        </p>
                                        
                                        
                                        <p class="submit">
                                            <button class="ym-button" type="submit" value="Suche" ><i18n:text>search</i18n:text></button><!-- class="button" -->
                                            <span><a href="/archive/objects/context:mws/methods/sdef:Context/get?mode=help&amp;locale={$locale}" class="ym-button"><i18n:text>Help</i18n:text></a></span>
                                        </p>
                                       
                                        
                                    </form>
                                </xsl:otherwise>
                            </xsl:choose>
                        </div>
                    </aside>
                </section>
            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>
    
    <xsl:template match="register">
        <div id="display">
        <h1 class="result"><i18n:text>Index</i18n:text></h1>
        <h2><i18n:text>People</i18n:text></h2>
    	<ul><xsl:apply-templates select="persons" /></ul>
        <h2><i18n:text>Writings</i18n:text></h2>
    	<ul><xsl:apply-templates select="works" /></ul>
        <h2><i18n:text>Places</i18n:text></h2>
    	<ul><xsl:apply-templates select="places" /></ul>
        </div>
    </xsl:template>
    
    <xsl:template match="persons">
    	<xsl:for-each select="person">
    		<li style="list-style: none;">
    			<xsl:if test="not(preceding-sibling::person/fullName = fullName)">
    				<xsl:value-of select="fullName" />
    			</xsl:if>
    			<span id="{@id}" style="display:block; font-size: 0.9em; color: #aaaaaa;">

    			<a>
    			<xsl:attribute name="href">
    			<xsl:text>/archive/objects/</xsl:text>
    			<xsl:value-of select="substring-before(@id, '_')" />
    			<xsl:text>/methods/sdef:TEI/get?locale=</xsl:text>
    			<xsl:value-of select="$locale" />
    			<xsl:text>#</xsl:text>
    			<xsl:value-of select="substring-after(@id, '_')" />
    			</xsl:attribute>
    			
    			<xsl:value-of select="journal" />
    			<xsl:text>, </xsl:text>
    			<xsl:value-of select="vol" />
    			<xsl:text>, </xsl:text>
    			<xsl:value-of select="page" />
    			</a>
    			</span></li>

    	</xsl:for-each>
    </xsl:template>
    
    <xsl:template match="works">
    	<xsl:for-each select="work">
    		<li style="list-style: none;">
    			<xsl:if test="not(preceding-sibling::work/fullName = fullName)">
    				<xsl:value-of select="fullName" />
    			</xsl:if>
    			
    			<span id="{@id}" style="display:block; font-size: 0.9em; color: #aaaaaa;">
    			<a>
    			<xsl:attribute name="href">
    				<xsl:text>/archive/objects/</xsl:text>
    			<xsl:value-of select="substring-before(@id, '_')" />
    			<xsl:text>/methods/sdef:TEI/get?locale=</xsl:text>
    			<xsl:value-of select="$locale" />
    			<xsl:text>#</xsl:text>
    			<xsl:value-of select="substring-after(@id, '_')" />
    			
    			</xsl:attribute>

    			
    			<xsl:value-of select="journal" />
    			<xsl:text>, </xsl:text>
    			<xsl:value-of select="vol" />
    			<xsl:text>, </xsl:text>
    			<xsl:value-of select="page" />
    			</a>
    			</span></li>

    	</xsl:for-each>
    </xsl:template>
    
    <xsl:template match="places">
    	<xsl:for-each select="place">
    		<li style="list-style: none;">
    			<xsl:if test="not(preceding-sibling::place/fullName = fullName)">
    				<xsl:value-of select="fullName" />
    			</xsl:if>
    			<span id="{@id}" style="display:block; font-size: 0.9em; color: #aaaaaa;">
    			<a>
    			<xsl:attribute name="href">
    				<xsl:text>/archive/objects/</xsl:text>
    			<xsl:value-of select="substring-before(@id, '_')" />
    			<xsl:text>/methods/sdef:TEI/get?locale=</xsl:text>
    			<xsl:value-of select="$locale" />
    			<xsl:text>#</xsl:text>
    			<xsl:value-of select="substring-after(@id, '_')" />
    			
    			</xsl:attribute>
    			<xsl:value-of select="journal" />
    			<xsl:text>, </xsl:text>
    			<xsl:value-of select="vol" />
    			<xsl:text>, </xsl:text>
    			<xsl:value-of select="page" />
    			</a>
    			</span></li>
    	</xsl:for-each>
    </xsl:template>
    
    <xsl:template name="optionValue">
        <xsl:if test="position()=1">
            <xsl:text>-- </xsl:text>
        </xsl:if>
        <i18n:text><xsl:value-of select="text"/></i18n:text>
        <xsl:if test="position()=1">
            <xsl:text> --</xsl:text>
        </xsl:if>
    </xsl:template>    

    <xsl:template match="t:body" mode="staticContent">

        <xsl:apply-templates select="t:div[@xml:lang=$lang]" mode="staticContent"/>

        <xsl:if test="not($mode='imprint') or not($mode='help')">
            <xsl:call-template name="publisher"/>
            <xsl:call-template name="date"/>
        </xsl:if>
    </xsl:template>

    <xsl:template name="publisher">
        <p class="publisher" style="float: left; margin-top: 1em;">
            <xsl:for-each
                select="/t:TEI/t:teiHeader/t:fileDesc/t:publicationStmt/t:publisher/t:persName">
                <xsl:value-of select="t:forename"/>
                <xsl:text> </xsl:text>
                <xsl:value-of select="t:surname"/>
                <xsl:if test="not(position()=last())">
                    <xsl:text>, </xsl:text>
                </xsl:if>
            </xsl:for-each>
        </p>
    </xsl:template>

    <xsl:template name="date">
        <p class="date" style="float: right; margin-top: 1em;">
            <xsl:for-each select="/t:TEI/t:teiHeader/t:fileDesc/t:publicationStmt">
                <xsl:value-of select="t:date/t:lang[@xml:lang=$lang]"/>
            </xsl:for-each>
        </p>
    </xsl:template>




    <xsl:template match="t:div" mode="staticContent">
        <div id="display">
        <h1 class="result">
            <xsl:value-of select="current()[@xml:lang=$lang]/t:head"/>
        </h1>
        <div>
            <xsl:for-each select="current()[@xml:lang=$lang]">
                <xsl:if test="child::t:div">
                    <xsl:for-each select="t:div">
                        <xsl:if test="t:head">
                        <h2>
                            <xsl:value-of select="t:head"/>
                        </h2>
                        </xsl:if>
                        <xsl:apply-templates select="t:p | t:list" mode="staticContent"/>
                        <xsl:if test="child::t:div">
                            <xsl:for-each select="t:div">
                                <h3 style="text-align: left; font-size: 1.2em; line-height: 1.4em; font-family:arial, verdana, helvetica, sans-serif;">
                                    <xsl:value-of select="t:head"/>
                                </h3>
                                <xsl:apply-templates select="t:p | t:list" mode="staticContent"/>
                            </xsl:for-each>
                        </xsl:if>
                    </xsl:for-each>
                </xsl:if>
                <xsl:if test="not(child::t:div)">
                    <xsl:apply-templates select="t:p | t:list" mode="staticContent"/>
                </xsl:if>
            </xsl:for-each>
        </div>
        </div>
    </xsl:template>

   

    <!--<xsl:template match="t:div" mode="staticContent">
        <h1>
            <xsl:value-of select="t:head"/>
        </h1>
        <xsl:apply-templates select="t:div | t:p" mode="staticContent"/>
       
      
    </xsl:template>-->

  <!--  <xsl:template match="t:div/t:div" mode="staticContent">
        <h2>
            <xsl:value-of select="t:head"/>
        </h2>
        <xsl:apply-templates select="t:div | t:p | t:list" mode="staticContent"/>
    </xsl:template>
    
    <xsl:template match="t:div/t:div/t:div" mode="staticContent">
        <h3>
            <xsl:value-of select="t:head"/>
        </h3>
        <xsl:apply-templates select="t:p | t:list" mode="staticContent"/>
    </xsl:template>-->

    <xsl:template match="t:p" mode="staticContent">
        <xsl:choose>
            <xsl:when test="@rend='SA'">
                <p>
                    <xsl:apply-templates select="t:seg" mode="staticContent" />
                </p>
            </xsl:when>
            <xsl:otherwise>
                <p>
                    <xsl:apply-templates select="t:seg" mode="staticContent" />
                </p>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    
    <xsl:template match="t:seg" mode="staticContent">
        <xsl:apply-templates mode="staticContent"/>
    </xsl:template>
    
    <xsl:template match="t:ref" mode="staticContent">
        <a>
           <xsl:attribute name="href">
        <xsl:value-of select="@target" />
           </xsl:attribute>
            <xsl:value-of select="." />
        </a>
    </xsl:template>

    <xsl:template match="t:list" mode="staticContent">
        <ul>
            <xsl:for-each select="t:item">
                <li>
                    <xsl:apply-templates mode="staticContent" />
                </li>
            </xsl:for-each>
        </ul>
    </xsl:template>
    
    <xsl:template match="t:emph" mode="staticContent">
        <em>
            <xsl:value-of select="." />
        </em>
    </xsl:template>

    <xsl:template name="createResults">
        <xsl:variable name="pid" select="substring-after(s:pid/@uri, '/')"/>
        <xsl:variable name="model" select="substring-after(s:model/@uri, '/')"/>
        <!--<xsl:variable name="context" select="concat('/', $pid)" />-->

        <xsl:choose>
            <xsl:when test="$model='cm:Context'">
                <li class="gesamt">
                    <span class="DublinCore">
                        <a class="newWindow" rel="0">
                            <xsl:attribute name="href">
                                <xsl:text>/archive/get/</xsl:text>
                                <xsl:value-of select="$pid"/>
				<xsl:text>/sdef:Object/getDC</xsl:text>
                            </xsl:attribute>

                            <xsl:text>» Dublin Core</xsl:text>
                        </a>
                    </span>
                    <a>
                        <xsl:attribute name="href">
                            <xsl:text>/archive/objects/</xsl:text>
                            <xsl:value-of select="$pid"/>
                            <xsl:text>/methods/sdef:Context/get?locale=</xsl:text>
                            <xsl:value-of select="$lang"/>
                            <xsl:text>&amp;context=</xsl:text>
                            <xsl:value-of select="s:language"/>

                        </xsl:attribute>
                        <xsl:value-of select="s:title"/>
                    </a>
                    <p>
                        <xsl:if test="string-length(s:creator)&gt;2">
                            <i18n:text>editedby</i18n:text>
                            <xsl:text> </xsl:text>
                            <xsl:value-of select="s:creator"/>
                        </xsl:if>
                        <!-- FIXME: passiert beim folgenden choose etwas sinnvolles? -->
                        <xsl:choose>
                            <xsl:when test="s:description='Gesamtverzeichnis'">
                                <xsl:if test="string-length(s:creator)&gt;2">
                                    <xsl:text>, </xsl:text>
                                </xsl:if>
                                <xsl:value-of select="s:Coverage"/>
                            </xsl:when>
                            <xsl:otherwise/>
                        </xsl:choose>
                    </p>
                </li>
            </xsl:when>


            <xsl:when test="$model='cm:BibTeX'">
                <li class="einzel">
                    <span class="DublinCore">
                        <a class="newWindow" rel="0">
                            <xsl:attribute name="href">
                                <xsl:text>/archive/get/</xsl:text>
                                <xsl:value-of select="$pid"/>
				<xsl:text>/sdef:Object/getDC</xsl:text>
                            </xsl:attribute>


                            <xsl:text>» Dublin Core</xsl:text>
                        </a>
                    </span>
                    <a>
                        <xsl:attribute name="href">
                            <xsl:text>/archive/objects/</xsl:text>
                            <xsl:value-of select="$pid"/>
                            <xsl:text>/methods/sdef:BibTeX/get?locale=</xsl:text>
                            <xsl:value-of select="$lang"/>
                        </xsl:attribute>
                        <i18n:text>
                            <xsl:value-of select="s:title"/>
                        </i18n:text>

                    </a>
                </li>
            </xsl:when>

            <xsl:otherwise>
                <li class="einzel">
                    <span class="DublinCore">
                        <a class="newWindow" rel="0">
                            <xsl:attribute name="href">
                                <xsl:text>/archive/get/</xsl:text>
                                <xsl:value-of select="$pid"/>
				<xsl:text>/sdef:Object/getDC</xsl:text>
                            </xsl:attribute>

                            <xsl:text>» Dublin Core</xsl:text>
                        </a>
                    </span>
                    <a>
                        <xsl:attribute name="href">
                            <xsl:text>/archive/objects/</xsl:text>
                            <xsl:value-of select="$pid"/>
                            <xsl:text>/methods/sdef:TEI/get?locale=</xsl:text>
                            <xsl:value-of select="$lang"/>
                            <xsl:text>&amp;context=</xsl:text>
                            <xsl:value-of select="s:language"/>
                            <xsl:text>;</xsl:text>
                            <xsl:value-of select="$cid" />
                        </xsl:attribute>
                        <xsl:value-of select="s:title"/>

                    </a>
                    <p>
                        <xsl:choose>
                            <xsl:when test="string-length(s:creator)&gt;1">
                                <i18n:text>editedby</i18n:text>
                                <xsl:text> </xsl:text>
                                <xsl:value-of select="s:creator"/>
                            </xsl:when>
                            <xsl:otherwise/>
                        </xsl:choose>
                    </p>
                </li>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    
</xsl:stylesheet>
