Revision 9d3cb802cf841b9e2a0a6902181513fa187de5f0 authored by Peter Stadler on 17 January 2020, 13:13:50 UTC, committed by Peter Stadler on 17 January 2020, 13:13:50 UTC
1 parent 97eac77
Raw File
guidelines.xsl.model
<xsl:stylesheet
  exclude-result-prefixes="xlink dbk rng teix xhtml a html xd  xs xsl fo tei"
  version="2.0"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
  xmlns:dbk="http://docbook.org/ns/docbook"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"
  xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns:rng="http://relaxng.org/ns/structure/1.0"
  xpath-default-namespace="http://www.tei-c.org/ns/1.0"
  xmlns:teix="http://www.tei-c.org/ns/Examples"
  xmlns:tei="http://www.tei-c.org/ns/1.0"
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:import
      href="http://www.tei-c.org/release/xml/tei/stylesheet/odds/odd2html.xsl"/>
  <xsl:import
      href="http://www.tei-c.org/release/xml/tei/stylesheet/odds/guidelines.xsl"/>

 <xsl:strip-space elements="tei:additional tei:address tei:adminInfo
			    tei:altGrp tei:altIdentifier tei:analytic
			    tei:app tei:appInfo tei:application
			    tei:arc tei:argument tei:attDef
			    tei:attList tei:availability tei:back
			    tei:biblFull tei:biblStruct tei:bicond
			    tei:binding tei:bindingDesc tei:body
			    tei:broadcast tei:cRefPattern tei:calendar
			    tei:calendarDesc tei:castGroup
			    tei:castList tei:category tei:certainty
			    tei:char tei:charDecl tei:charProp
			    tei:choice tei:cit tei:classDecl
			    tei:classSpec tei:classes tei:climate
			    tei:cond tei:constraintSpec tei:correction
			    tei:custodialHist tei:decoDesc
			    tei:dimensions tei:div tei:div1 tei:div2
			    tei:div3 tei:div4 tei:div5 tei:div6
			    tei:div7 tei:divGen tei:docTitle tei:eLeaf
			    tei:eTree tei:editionStmt
			    tei:editorialDecl tei:elementSpec
			    tei:encodingDesc tei:entry tei:epigraph
			    tei:epilogue tei:equipment tei:event
			    tei:exemplum tei:fDecl tei:fLib
			    tei:facsimile tei:figure tei:fileDesc
			    tei:floatingText tei:forest tei:front
			    tei:fs tei:fsConstraints tei:fsDecl
			    tei:fsdDecl tei:fvLib tei:gap tei:glyph
			    tei:graph tei:graphic tei:group
			    tei:handDesc tei:handNotes tei:history
			    tei:hom tei:hyphenation tei:iNode tei:if
			    tei:imprint tei:incident tei:index
			    tei:interpGrp tei:interpretation tei:join
			    tei:joinGrp tei:keywords tei:kinesic
			    tei:langKnowledge tei:langUsage
			    tei:layoutDesc tei:leaf tei:lg tei:linkGrp
			    tei:list tei:listBibl tei:listChange
			    tei:listEvent tei:listForest tei:listNym
			    tei:listOrg tei:listPerson tei:listPlace
			    tei:listRef tei:listRelation
			    tei:listTranspose tei:listWit tei:location
			    tei:locusGrp tei:macroSpec tei:metDecl
			    tei:moduleRef tei:moduleSpec tei:monogr
			    tei:msContents tei:msDesc tei:msIdentifier
			    tei:msItem tei:msItemStruct tei:msPart
			    tei:namespace tei:node tei:normalization
			    tei:notatedMusic tei:notesStmt tei:nym
			    tei:objectDesc tei:org tei:particDesc
			    tei:performance tei:person tei:personGrp
			    tei:physDesc tei:place tei:population
			    tei:postscript tei:precision
			    tei:profileDesc tei:projectDesc
			    tei:prologue tei:publicationStmt
			    tei:quotation tei:rdgGrp tei:recordHist
			    tei:recording tei:recordingStmt
			    tei:refsDecl tei:relatedItem tei:relation
			    tei:relationGrp tei:remarks tei:respStmt
			    tei:respons tei:revisionDesc tei:root
			    tei:row tei:samplingDecl tei:schemaSpec
			    tei:scriptDesc tei:scriptStmt tei:seal
			    tei:sealDesc tei:segmentation
			    tei:seriesStmt tei:set tei:setting
			    tei:settingDesc tei:sourceDesc
			    tei:sourceDoc tei:sp tei:spGrp tei:space
			    tei:spanGrp tei:specGrp tei:specList
			    tei:state tei:stdVals tei:subst
			    tei:substJoin tei:superEntry
			    tei:supportDesc tei:surface tei:surfaceGrp
			    tei:table tei:tagsDecl tei:taxonomy
			    tei:teiCorpus tei:teiHeader tei:terrain
			    tei:text tei:textClass tei:textDesc
			    tei:timeline tei:titlePage tei:titleStmt
			    tei:trait tei:transpose tei:tree
			    tei:triangle tei:typeDesc tei:vAlt
			    tei:vColl tei:vDefault tei:vLabel
			    tei:vMerge tei:vNot tei:vRange tei:valItem
			    tei:valList tei:vocal"/>

  <xsl:key name="IDS" match="*[@xml:id]" use="@xml:id"/>
  <xsl:param name="googleAnalytics"></xsl:param>
  <xsl:param name="pageLayout">Complex</xsl:param>
  <xsl:param name="lang"/>
  <xsl:param name="doclang"/>
  <xsl:param name="STDOUT">false</xsl:param>
  <xsl:param name="splitLevel">0</xsl:param>
  <xsl:param name="footnoteFile">false</xsl:param>
  <xsl:param name="auto">false</xsl:param>
  <xsl:param name="numberFrontHeadings">true</xsl:param>
  <xsl:param name="splitBackmatter">true</xsl:param>
  <xsl:param name="splitFrontmatter">true</xsl:param>
  <xsl:param name="displayMode">both</xsl:param>
  <xsl:param name="feedbackURL">https://tei-c.org/about/contact/</xsl:param>
  <xsl:param name="homeLabel">TEI P5 Guidelines</xsl:param>
  <xsl:param name="homeWords">TEI P5</xsl:param>
  <xsl:param name="institution">Text Encoding Initiative</xsl:param>
  <xsl:param name="outputDir">Guidelines</xsl:param>
  <xsl:param name="parentURL">https://tei-c.org/about/</xsl:param>
  <xsl:param name="parentWords">TEI Consortium</xsl:param>
  <xsl:param name="cssFile">guidelines.css</xsl:param>
  <xsl:param name="cssSecondaryFile">odd.css</xsl:param>
  <xsl:param name="cssPrintFile">guidelines-print.css</xsl:param>
  <xsl:param name="teiWeb"></xsl:param>
  <xsl:param name="divOffset">2</xsl:param>
  <xsl:param name="verboseSpecDesc">false</xsl:param>


  <xsl:template match="/">
    <xsl:result-document doctype-public="{$doctypePublic}"
			 omit-xml-declaration = "yes"			  
			 doctype-system="{$doctypeSystem}" 
			 encoding="{$outputEncoding}"
			 href="{$outputDir}/index-toc.html" 
			 method="{$outputMethod}">
      <html>
	<head>
	  <title>TEI P5: Guidelines for Electronic Text and Interchange</title>
	  <meta http-equiv="Refresh" content="3; url=index.html" />
	</head>
	<body>
	  <p>The TEI Guidelines Table of Contents has been moved to <a href="index.html">index.html</a>.</p>
	  <p>If you are not redirected after a few seconds, please click on the
	  link above.</p>
	</body>
      </html>
    </xsl:result-document>

    <xsl:result-document doctype-public="{$doctypePublic}"
			 omit-xml-declaration = "yes"			  
			 doctype-system="{$doctypeSystem}" 
			 encoding="{$outputEncoding}"
			 href="{$outputDir}/TitlePageRecto.html" 
			 method="{$outputMethod}">
      <html>
	<xsl:comment>THIS IS A GENERATED FILE. DO NOT EDIT (97) </xsl:comment>
	<head>
	  <title>
	    <xsl:value-of select="tei:generateTitle(.)"/>
	  </title>
	  <xsl:choose>
	    <xsl:when test="$cssFile = ''"/>
	    <xsl:when test="$cssFileInclude='true'">
	      <style>
		<include href="{$cssFile}" parse="text" xmlns="http://www.w3.org/2001/XInclude"/>
	      </style>
	    </xsl:when>
	    <xsl:otherwise>
	      <link href="{$cssFile}" rel="stylesheet"
		    type="text/css"/>
	    </xsl:otherwise>
	  </xsl:choose>
	  <xsl:if test="not($cssSecondaryFile = '')">
	    <link href="{$cssSecondaryFile}" rel="stylesheet"
		  type="text/css"/>
	  </xsl:if>
	  <xsl:call-template name="metaHTML">
	    <xsl:with-param name="title"
			    select="string-join(tei:generateTitle(.),'')"/>
	  </xsl:call-template>
	  <xsl:call-template name="includeJavascript"/>
	  <xsl:call-template name="javascriptHook"/>
	</head>
	<body id="TOP">
	  <xsl:call-template name="bodyHook"/>
	  <div id="onecol" class="main-content">
	    <xsl:apply-templates select="/TEI/text/front/titlePage/*"/>
	  </div>
	  <xsl:call-template name="stdfooter"/>
	</body>
      </html>
    </xsl:result-document>    
    <xsl:apply-imports/>
    <xsl:for-each select="key('ELEMENTDOCS',1)">
      <xsl:variable name="me" select="@ident"/>
      <xsl:variable name="mychapter" select="ancestor::div[last()]/@xml:id"/>
      <xsl:variable name="langs">
	<xsl:value-of select="concat(normalize-space(tei:generateDocumentationLang(.)),' ')"/>
      </xsl:variable>
      <xsl:result-document doctype-public="{$doctypePublic}"
			   doctype-system="{$doctypeSystem}" 
			   encoding="{$outputEncoding}"
			   omit-xml-declaration = "yes"
			   href="{$outputDir}/examples-{$me}.html" 
			   method="{$outputMethod}">
	<html>
	  <xsl:comment>THIS IS A GENERATED FILE. DO NOT EDIT (98) </xsl:comment>
	  <head>
	    <title>
              <xsl:sequence select="tei:i18n('Example')"/>
	      <xsl:text>: &lt;</xsl:text>
	      <xsl:value-of select="$me"/>
	      <xsl:text>&gt; </xsl:text>
	      <xsl:sequence select="tei:makeGloss(.,$langs)"/>
	    </title>
	    <link href="{$cssFile}" rel="stylesheet" type="text/css"/>
	    <xsl:if test="not($cssSecondaryFile = '')">
	      <link href="{$cssSecondaryFile}" rel="stylesheet"
		    type="text/css"/>
	    </xsl:if>
	    <meta
		content="Text Encoding Initiative Consortium XSLT stylesheets"
		name="generator"/>
	  <xsl:call-template name="metaHTML">
	    <xsl:with-param name="title">
		<xsl:sequence select="tei:i18n('Example')"/>
		<xsl:text>: </xsl:text>
		<xsl:value-of select="$me"/>
		<xsl:text> </xsl:text>
		<xsl:sequence select="tei:makeGloss(.,$langs)"/>
	    </xsl:with-param>
	  </xsl:call-template>
	    <xsl:call-template name="includeJavascript"/>
	    <xsl:call-template name="javascriptHook"/>
	  </head>
	  <body id="TOP">
	    <xsl:call-template name="bodyHook"/>
	    <div class="main-content">
	      <xsl:call-template name="startDivHook"/>
	      <h3>
		<xsl:sequence select="tei:i18n('Example')"/>
		<a href="ref-{$me}.html">
		<xsl:text>: &lt;</xsl:text>
		<xsl:value-of select="$me"/>
		<xsl:text>&gt; </xsl:text>
		</a>
		<xsl:sequence select="tei:makeGloss(.,$langs)"/>
	      </h3>
	      <p>These search results reproduce every example of the
	      use of <xsl:text>&lt;</xsl:text>
	      <xsl:value-of select="$me"/>
	      <xsl:text>&gt;</xsl:text> in the Guidelines, including all localised
	      and translated versions. In some cases, the examples have been drawn
	      from discussion of other elements in the Guidelines and illustrating
	      the use of <xsl:text>&lt;</xsl:text>
	      <xsl:value-of select="$me"/>
	      <xsl:text>&gt;</xsl:text>
	      is not the main 
	      focus of the passage in question. In other cases, examples may be direct 
	      translations of each other, and hence identical from the perspective of 
	      their encoding.</p>	      
		<xsl:for-each
		    select="/TEI/text/body/div[@xml:id=$mychapter]">
		  <xsl:if test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
		    <ul>
		      <li>
			<b>
			  <a href="#{@xml:id}">
			    <xsl:call-template name="header"/> <em> (defining module)</em>
			  </a>
			</b>
		      </li>
		    </ul>
		  </xsl:if>
		</xsl:for-each>
	      <xsl:variable name="items">
		<xsl:for-each
		    select="/TEI/text/body/div[not(@xml:id=$mychapter)]">
		  <xsl:if test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
		    <li>
		      <a href="#{@xml:id}">
			<xsl:call-template name="header"/>
			<xsl:if test="./ancestor::*/@module = $me/ancestor::*/@module">
			  <em>(defining module)</em>
			</xsl:if>
		      </a>
		    </li>
		  </xsl:if>
		</xsl:for-each>
	      </xsl:variable>
              <xsl:if test="count($items/html:li)&gt;0">
                <ul>
                  <xsl:copy-of select="$items/html:li"/>
                </ul>
              </xsl:if>
	      <xsl:for-each
		  select="/TEI/text/body/div[@xml:id=$mychapter]">
		<xsl:if
		    test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
		  <xsl:call-template name="showExamplesFromDiv">
		    <xsl:with-param name="me" select="$me"/>
		  </xsl:call-template>
		</xsl:if>
	      </xsl:for-each>
	      <xsl:for-each
		  select="/TEI/text/body/div[not(@xml:id=$mychapter)]">
		<xsl:if
		    test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
		  <xsl:call-template name="showExamplesFromDiv">
		    <xsl:with-param name="me" select="$me"/>
		  </xsl:call-template>
		</xsl:if>
	      </xsl:for-each>
	    </div>
	    <xsl:call-template name="stdfooter">
	      <xsl:with-param name="file">
		<xsl:text>examples-</xsl:text>
		<xsl:value-of select="$me"/>
	      </xsl:with-param>
	    </xsl:call-template>
	  </body>
	</html>
      </xsl:result-document>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="showExamplesFromDiv">
    <xsl:param name="me"/>
    <h4 id="{@xml:id}">
      <xsl:call-template name="header"/>
    </h4>
    <xsl:for-each select="key('EXAMPLES',concat(@xml:id,$me))">
      <xsl:variable name="pos">
	<xsl:number level="any" from="teix:egXML"/>
      </xsl:variable>
      <xsl:if test="number($pos)=1 or ($me='egXML' and
		    number($pos)=2)">
	<hr/>
	<p>
	  <xsl:choose>
	    <xsl:when test="ancestor::elementSpec">
	      <a
		  href="../../{tei:checkLang(ancestor::exemplum/@xml:lang)}/html/ref-{ancestor::elementSpec/@ident}.html">
		<xsl:text>&lt;</xsl:text>
		<xsl:value-of
		    select="ancestor::elementSpec/@ident"/>
		<xsl:text>&gt;</xsl:text>
	      </a>
	    </xsl:when>
	    <xsl:when test="ancestor::classSpec">
	      <a
		  href="../../{tei:checkLang(ancestor::exemplum/@xml:lang)}/html/ref-{ancestor::classSpec/@ident}.html">
		<xsl:value-of
		    select="ancestor::classSpec/@ident"/>
	      </a>
	    </xsl:when>
	    <xsl:otherwise>
	      <xsl:for-each select="ancestor::div[@xml:id and head][1]">
		<a>
		  <xsl:attribute name="href">
		    <xsl:apply-templates select="." mode="generateLink"/>
		  </xsl:attribute>
		  <xsl:call-template name="header"/>
		</a>
	      </xsl:for-each>
	    </xsl:otherwise>
	  </xsl:choose>
	</p>
	<xsl:apply-templates select="ancestor::teix:egXML">
	  <xsl:with-param name="simple">true</xsl:with-param>
	  <xsl:with-param name="highlight"><xsl:value-of select="$me"/></xsl:with-param>
	</xsl:apply-templates>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>

  

  <xsl:template name="startDivHook">
    <xsl:if
      test="not(parent::div) or not(local-name(preceding::*[1])='head')">
      <div>
	<xsl:choose>
        <xsl:when test="not(parent::div) and child::div">
	  <xsl:attribute name="class">
	    <xsl:text>miniTOC miniTOC_left</xsl:text>
	  </xsl:attribute>
	  <xsl:call-template name="subtoc"/>
	</xsl:when>
	<xsl:otherwise>
	  <xsl:attribute name="class">
	    <xsl:text>miniTOC miniTOC_right</xsl:text>
	  </xsl:attribute>
	</xsl:otherwise>
	</xsl:choose>
	<ul class="subtoc">
	  <li class="subtoc"><xsl:call-template name="previousLink"/></li>
	  <li class="subtoc"><xsl:call-template name="nextLink"/></li>
	  <li class="subtoc"><a class="navigation" href="index.html">
	  <xsl:sequence select="tei:i18n('homeWord')"/>
	  </a> </li>
	  <xsl:choose>
	      <xsl:when test="self::elementSpec">
		<li class="subtoc">
		<a class="navigation" href="REF-ELEMENTS.html">
		  <xsl:call-template name="showHead">
		    <xsl:with-param name="ID">
		      <xsl:text>REF-ELEMENTS</xsl:text>
		    </xsl:with-param>
		  </xsl:call-template>
		</a>
		</li>
	    </xsl:when>
	      <xsl:when test="self::classSpec[@type='model']">
		<li class="subtoc">
		<a class="navigation" href="REF-CLASSES-MODEL.html">
		  <xsl:call-template name="showHead">
		    <xsl:with-param name="ID">
		      <xsl:text>REF-CLASSES-MODEL</xsl:text>
		    </xsl:with-param>
		  </xsl:call-template>
		</a>
		</li>
	    </xsl:when>
	      <xsl:when test="self::classSpec[@type='atts']">
		<li class="subtoc">
		<a class="navigation" href="REF-CLASSES-ATTS.html">
		<xsl:call-template name="showHead">
		  <xsl:with-param name="ID">
		    <xsl:text>REF-CLASSES-ATTS</xsl:text>
		  </xsl:with-param>
		</xsl:call-template>
		</a>
		</li>
	    </xsl:when>
	      <xsl:when test="self::macroSpec">
		<li class="subtoc">
		<a class="navigation" href="REF-MACROS.html">
		  <xsl:call-template name="showHead">
		    <xsl:with-param name="ID">
		      <xsl:text>REF-MACROS</xsl:text>
		    </xsl:with-param>
		  </xsl:call-template>
		</a>
		</li>
	    </xsl:when>
	    <xsl:otherwise>
	      <!--
	      <xsl:for-each select="ancestor::div">
		<div>
		  <xsl:attribute name="style">
		    <xsl:text>margin-left:</xsl:text>
		    <xsl:value-of select="count(ancestor::div) + 1"/>
		    <xsl:text>em;</xsl:text>
		  </xsl:attribute>
		  <xsl:text>&#x21B3;</xsl:text>
		<a class="UP">
		  <xsl:attribute name="href">
		    <xsl:apply-templates mode="generateLink"
					 select="."/>
		  </xsl:attribute>
		  <xsl:call-template name="headerLink">
		    <xsl:with-param name="minimal"
				    select="$minimalCrossRef"/>
		  </xsl:call-template>
		</a>
		</div>
	      </xsl:for-each>
	      -->
	    </xsl:otherwise>
	  </xsl:choose>

	</ul>
      </div>
    </xsl:if>
  </xsl:template>


  <xsl:template name="mainPage">
    <xsl:param name="currentID"/>
    <div id="onecol" class="main-content">
      <xsl:choose>
	<xsl:when test="not($currentID='')">
	  <xsl:call-template name="mainFrame">
	    <xsl:with-param name="currentID" select="$currentID"/>
	    <xsl:with-param name="minimal">true</xsl:with-param>
	  </xsl:call-template>
	  <xsl:call-template name="partialFootNotes">
	    <xsl:with-param name="currentID" select="$currentID"/>
	  </xsl:call-template>
	</xsl:when>
	<xsl:otherwise>
	  <xsl:call-template name="mainTOC"/>
	</xsl:otherwise>
      </xsl:choose>
      <xsl:call-template name="stdfooter">
        <xsl:with-param name="file" select="if (string-length($currentID) gt 0) then $currentID else 'index'"/>
      </xsl:call-template>
    </div>
  </xsl:template>





  <xsl:template name="mainTOC">
    <xsl:param name="force"/>
  	
  	
<!-- MDH 2013-06: changes for new TOC page layout.	-->
  	
  	<p class="lang_links"> 
  		[<a href="../../en/html/index.html">English</a>] 
  		[<a href="../../de/html/index.html">Deutsch</a>] 
  		[<a href="../../es/html/index.html">Español</a>] 
  		[<a href="../../it/html/index.html">Italiano</a>] 
  		[<a href="../../fr/html/index.html">Français</a>] 
  		[<a href="../../ja/html/index.html">日本語</a>]
  		[<a href="../../ko/html/index.html">한국어</a>] 
  		[<a href="../../zh-TW/html/index.html">中文</a>] 
  		
  		<br/>
  		
  		<a href="../../en/Guidelines.pdf" class="ebookLink">
  			<img src="icons/e-book-icons/mdh_pdf_doc_32x32.png" width="32" height="32" 
  				alt="PDF version for downloading and printing."
  				title="PDF version for downloading and printing."/>
  		</a>
  		<a href="../../en/Guidelines.epub" class="ebookLink">
  			<img src="icons/e-book-icons/mdh_epub_doc_32x32.png" width="32" height="32" 
  				alt="ePub version for mobile devices."
  				title="ePub version for mobile devices."/>
  		</a>
  		<a href="../../en/Guidelines.mobi" class="ebookLink">
  			<img src="icons/e-book-icons/mdh_mobi_doc_32x32.png" width="32" height="32" 
  				alt="Mobi version (for Kindle)."
  				title="Mobi version (for Kindle)."/>
  		</a>
  		
  		
  	</p>
  	
  	<div class="col_left">
  		<div class="toc_front">
  			<h3>
  				<xsl:sequence select="tei:i18n('Front Matter')"/>
  			</h3>
  			<ul class="toc{$force} toc_front">
  				<li>
  					<a href="TitlePageRecto.html">
  						<xsl:sequence select="tei:i18n('title')"/>
  					</a>
  				</li>
  				<xsl:for-each
  					select="ancestor-or-self::TEI/text/front">
  					<xsl:if test="div">
  						<xsl:apply-templates mode="maketoc" select="div">
  							<xsl:with-param name="forcedepth" select="$force"/>
  						</xsl:apply-templates>
  					</xsl:if>
  				</xsl:for-each>
  			</ul>
  		</div>
  		
  		<div class="toc_back">
  			<h3>
  				<xsl:sequence select="tei:i18n('Back Matter')"/>
  			</h3>
  			<xsl:for-each
  				select="ancestor-or-self::TEI/text/back">
  				<xsl:if test="div">
  					<ul class="toc{$force} toc_back">
  						<xsl:apply-templates mode="maketoc"
  							select="div">
  							<xsl:with-param name="forcedepth" select="$force"/>
  						</xsl:apply-templates>
  					</ul>
  				</xsl:if>
  			</xsl:for-each>
  		</div>
  		
  		
  	</div>
  	
  	<div class="col_centre">
  		
  		<div class="toc_body">
  			<h3>
  				<xsl:sequence select="tei:i18n('Text body')"/>
  			</h3>
  			<xsl:for-each
  				select="ancestor-or-self::TEI/text/body">
  				<xsl:if          test="div">
  					<ul class="toc{$force}  toc_body">
  						<xsl:apply-templates mode="maketoc"
  							select="div">
  							<xsl:with-param name="forcedepth" select="$force"/>
  						</xsl:apply-templates>
  					</ul>
  				</xsl:if>
  			</xsl:for-each>
  		</div>
  		
  	</div>
  	
  	<div class="col_right">
  		
  		
  		<div>
  			<h3>TEI sourcecode</h3>
  			<ul>
  			  <li>
  			    <a href="https://tei-c.org/guidelines/p5/using-the-tei-github-repository/">Getting and Using the TEI Sources.</a>
  			  </li>
   				<li>
  				  <a href="https://github.com/TEIC/TEI">TEI GitHub Repository</a>
  				</li>
  				<li>
  					<a href="https://github.com/TEIC/TEI/issues">Bug Reports, Feature Requests, etc.</a>
  				</li>
  			</ul>
  			
  		</div>
  	</div>
    

  </xsl:template>



  <xsl:template match="divGen[@type='toc']"/>

  <xsl:template name="javascriptHook">
    <script type="text/javascript" src="jquery-1.2.6.min.js"/>
    <script type="text/javascript" src="columnlist.js"/>
    <script type="text/javascript" src="popupFootnotes.js"/>
    <!--CAMPAIGN LINK-->
    <script type="text/javascript">
        $(function() {
         $('ul.attrefs-class').columnizeList({cols:3,width:30,unit:'%'});
         $('ul.attrefs-element').columnizeList({cols:3,width:30,unit:'%'});
         $(".displayRelaxButton").click(function() {
           $(this).parent().find('.RNG_XML').toggle();
           $(this).parent().find('.RNG_Compact').toggle();
         });
         $(".tocTree .showhide").click(function() {
          $(this).find(".tocShow,.tocHide").toggle();
          $(this).parent().find("ul.continuedtoc").toggle();
	  });
        })
    </script>
    <xsl:if test="not($googleAnalytics='')">
      <script type="text/javascript" src="udm-all.js"/>
      <link rel="stylesheet" href="udm.css" />
    </xsl:if>

    <xsl:call-template name="jsForOdds"/>

  </xsl:template>
  


<xsl:template name="bodyHook">
  <xsl:if test="not($googleAnalytics='')">
    <script type="text/javascript" src="udm-dom.js"/>
    <script type="text/javascript" src="udm-mod-keyboard.js"/>
  </xsl:if>
  <div id="container">
    <div id="banner">
      <a href="https://tei-c.org"><img src="Images/banner.jpg"
	   alt="Text Encoding Initiative logo and banner"/></a>
    </div>
    <xsl:choose>
      <xsl:when test="$googleAnalytics=''">    
      </xsl:when>
      <xsl:otherwise>
	<xsl:apply-templates xpath-default-namespace=""
	    select="document('teic-index.xml')//ul[@id='udm']" mode="copyhtml"/>
      </xsl:otherwise>
    </xsl:choose>
  </div>
  
  <xsl:if test="not($googleAnalytics='')">    
    <div id="searchbox" style="float:left;">
      <form
	  action="https://www.google.com/search"
	  method="get">
	<fieldset>
	  <input
	      style="color:#225588;"
	      value=""
	      maxlength="255"
	      size="20" name="q"
	      type="text"
	      />&#160;<select
	      name="sitesearch">
	  <option
	      value="http://www.tei-c.org/">Entire site</option>
	  <option
	      value="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/"
	      selected="selected">P5 Guidelines
	  <xsl:choose>
	    <xsl:when test="$documentationLanguage='en'"> — English</xsl:when>
	    <xsl:when test="$documentationLanguage='de'"> — Deutsch</xsl:when>
	    <xsl:when test="$documentationLanguage='es'"> — Español</xsl:when>
	    <xsl:when test="$documentationLanguage='it'"> — Italiano</xsl:when>
	    <xsl:when test="$documentationLanguage='fr'"> — Français</xsl:when>
	    <xsl:when test="$documentationLanguage='ja'"> — 日本語</xsl:when>
	    <xsl:when test="$documentationLanguage='ko'"> — 한국어</xsl:when>
	    <xsl:when test="$documentationLanguage='zh-TW'"> — 中文</xsl:when>
	  </xsl:choose>
	  </option>
	  <option value="http://www.tei-c.org/Guidelines/P4/html/">P4 Guidelines</option>
	  </select>&#160;<input style="font-size:100%; font-weight:bold;
	  color:#FFFFFF; background-color:#225588; height: 2em;"
	  value="Search" type="submit" />
	</fieldset>
      </form>
    </div>
    </xsl:if>
  <div
      class="mainhead">
    <h1>P5: 
    <xsl:sequence select="tei:i18n('GuidelinesTEI')"/>
    </h1>
    <p>      
      <xsl:value-of select="/TEI/teiHeader/fileDesc/editionStmt/edition"/>
      </p>
  </div>
</xsl:template>



  <xsl:template name="calculateFigureNumber">
    <xsl:choose>
      <xsl:when test="ancestor::front">
	<xsl:sequence select="tei:i18n('figureWord')"/>
	<xsl:text> </xsl:text>
	<xsl:number count="figure[head]" from="div[parent::front]" level="any"/>
	<xsl:for-each select="ancestor::div[parent::front]">
	  <xsl:number/>
	</xsl:for-each>
	<xsl:text>.</xsl:text>
      </xsl:when>
      <xsl:when test="ancestor::back">
	<xsl:sequence select="tei:i18n('figureWord')"/>
	<xsl:text> </xsl:text>
	<xsl:for-each select="ancestor::div[parent::back]">
	  <xsl:number/>
	</xsl:for-each>
	<xsl:text>.</xsl:text>
	<xsl:number count="figure[head]" from="div[parent::back]" level="any"/>
      </xsl:when>
      <xsl:when test="ancestor::body">
	<xsl:sequence select="tei:i18n('figureWord')"/>
	<xsl:text> </xsl:text>
	<xsl:for-each select="ancestor::div[parent::body]">
	  <xsl:number/>
	</xsl:for-each>
	<xsl:text>.</xsl:text>
	<xsl:number count="figure[head]" from="div[parent::body]" level="any"/>
      </xsl:when>
    </xsl:choose>
  </xsl:template>



  <xsl:function name="tei:escapeChars" as="xs:string">
    <xsl:param name="letters"/>
    <xsl:param name="context"/>
    <xsl:value-of select="normalize-unicode($letters,'NFC')"/>
  </xsl:function>


  <xsl:template name="myi18n">
    <xsl:param name="word"/>
    <xsl:choose>
      <xsl:when test="$word eq 'defaultValValidUntil'">
	<xsl:text>The value will no longer be a default after</xsl:text>
      </xsl:when>
      <xsl:when test="$word='validuntil'">
	<xsl:text>This feature will be withdrawn after</xsl:text>
      </xsl:when>
      <xsl:when test="$word='previousWord'">
        <span class="icon">
          <xsl:text>« </xsl:text>
        </span>
      </xsl:when>
      <xsl:when test="$word='upWord'">
        <span class="icon">
          <xsl:text>↑ </xsl:text>
        </span>
      </xsl:when>
      <xsl:when test="$word='nextWord'">
        <span class="icon">
          <xsl:text>» </xsl:text>
        </span>
      </xsl:when>
    </xsl:choose>
  </xsl:template>
  
  <xsl:function name="tei:checkLang" as="xs:string">
    <xsl:param name="lang"/>
      <xsl:sequence select="if
			    ($lang=('de','en','es','fr','it','ko','zh-TW'))
			    then $lang else 'en'"/>
  </xsl:function>

  <xsl:template match="*" mode="copyhtml">
    <xsl:copy>
      <xsl:apply-templates select="@*|*|processing-instruction()|comment()|text()" mode="copyhtml"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="comment()|@*|processing-instruction()|text()" mode="copyhtml">
    <xsl:copy-of select="."/>
  </xsl:template>

  <xsl:template match="a/@href"  mode="copyhtml">
    <xsl:attribute name="href">
      <xsl:if test="starts-with(.,'/')">
	<xsl:text>https://www.tei-c.org</xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </xsl:attribute>
  </xsl:template>

</xsl:stylesheet>
back to top