Commit 7a18f9e2 authored by Dennis Neumann's avatar Dennis Neumann
Browse files

Leave only the HTML splitting templates, i. e. remove the old ones for whole article

parent a64c0940
......@@ -30,10 +30,7 @@ Furthermore, a warning message is generated that contains data of the first occu
-->
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.tei-c.org/ns/1.0" xmlns:gfl="http://sub.gfl.de"
......@@ -56,18 +53,6 @@ Furthermore, a warning message is generated that contains data of the first occu
</add>
</xsl:template>
<xsl:template match="text()" mode="html_for_whole_article">
<xsl:variable name="currentText" select="replace(., '\s+', ' ')" />
<xsl:choose>
<xsl:when test="ends-with(., '&#0173;')">
<xsl:value-of select="replace($currentText, '&#0173;', '-')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$currentText" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="text()" mode="text_only">
<xsl:variable name="currentText" select="replace(., '\s+', ' ')" />
<xsl:choose>
......@@ -252,195 +237,7 @@ Furthermore, a warning message is generated that contains data of the first occu
</xsl:template>
<!-- ++++++++++++ HTML +++++++++++++++++++ -->
<xsl:template match="*" mode="html_for_whole_article">
<!--xsl:if test=".//text()"-->
<xsl:message>
<xsl:text>Unknown element &lt;</xsl:text>
<xsl:value-of select="local-name()" />
<xsl:if test="@rendition">
<xsl:text> rendition="</xsl:text>
<xsl:value-of select="@rendition" />
<xsl:text>"</xsl:text>
</xsl:if>
<xsl:if test="@type">
<xsl:text> type="</xsl:text>
<xsl:value-of select="@type" />
<xsl:text>"</xsl:text>
</xsl:if>
<xsl:text>&gt; - first occurrence: </xsl:text>
</xsl:message>
<span class="unknown-element">
<xsl:apply-templates mode="html_for_whole_article" />
</span>
<!--/xsl:if-->
</xsl:template>
<xsl:template match="body | div" mode="html_for_whole_article">
<xsl:apply-templates mode="html_for_whole_article"/>
</xsl:template>
<xsl:template match="p | opener | salute | seg | bibl | closer | signed | dateline | date
| label[not(@rendition)] | choice | abbr | expan | postscript" mode="html_for_whole_article">
<div class="{local-name()}">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="lb" mode="html_for_whole_article">
<br />
</xsl:template>
<xsl:template match="space[@unit='lines']" mode="html_for_whole_article">
<xsl:variable name="emptyLines" select="@quantity" />
<xsl:choose>
<xsl:when test="$emptyLines castable as xs:integer">
<xsl:for-each select="1 to $emptyLines">
<br />
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<br />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="name[@type='place']" mode="html_for_whole_article">
<div class="place">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="name[@type='org']" mode="html_for_whole_article">
<div class="org">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="name[@type='person']" mode="html_for_whole_article">
<div class="person">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="name[@type='object']" mode="html_for_whole_article">
<div class="object">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="pb" mode="html_for_whole_article">
<div class="page-break">
<xsl:variable name="facsId" select="substring(@facs, 2, string-length(@facs))" />
<xsl:variable name="graphicUrl" select="id($facsId)/@url" />
<xsl:variable name="graphicUrlWithoutJpg">
<xsl:value-of select="if (ends-with($graphicUrl, '.jpg')) then substring($graphicUrl, 1, string-length($graphicUrl)-4) else $graphicUrl" />
</xsl:variable>
<xsl:choose>
<xsl:when test="@n ne '' and $graphicUrlWithoutJpg">
<a href="{concat('/', $graphicUrlWithoutJpg)}" target="_blank">
<xsl:value-of select="@n" />
</a>
</xsl:when>
<xsl:when test="@n ne ''">
<xsl:value-of select="@n" />
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<xsl:template match="rs[@type='person']" mode="html_for_whole_article">
<div class="rs-person">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="rs[@type='place']" mode="html_for_whole_article">
<div class="rs-place">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="note[@type='com']" mode="html_for_whole_article">
<div class="note-comment">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="note[@type='footnote']" mode="html_for_whole_article">
<div class="note-footnote">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="note[not(@type)]" mode="html_for_whole_article">
<div class="note">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="hi[@rendition='simple:underline']" mode="html_for_whole_article">
<div class="underline">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="hi[@rendition='simple:doubleunderline']" mode="html_for_whole_article">
<div class="doubleunderline">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="hi[@rendition='simple:superscript']" mode="html_for_whole_article">
<sup>
<xsl:apply-templates mode="html_for_whole_article" />
</sup>
</xsl:template>
<xsl:template match="hi[@rendition='simple:subscript']" mode="html_for_whole_article">
<sub>
<xsl:apply-templates mode="html_for_whole_article" />
</sub>
</xsl:template>
<xsl:template match="hi[@rendition='simple:italic']" mode="html_for_whole_article">
<div class="italic">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="hi[@rendition='simple:letterspace']" mode="html_for_whole_article">
<div class="letterspace">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="hi[@rendition='simple:right']" mode="html_for_whole_article">
<div class="right">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<xsl:template match="ref[@target]" mode="html_for_whole_article">
<a href="{@target}">
<xsl:apply-templates mode="html_for_whole_article" />
</a>
</xsl:template>
<xsl:template match="head[@rendition] | label[@rendition]" mode="html_for_whole_article">
<xsl:variable name="classNames" select="local-name(), substring-after(@rendition, 'simple:')" />
<div class="{$classNames}">
<xsl:apply-templates mode="html_for_whole_article" />
</div>
</xsl:template>
<!-- %%%%%%%%%%%%% page splitting %%%%%%%%%%%%%%%%%%%%%%% -->
<!-- %%%%%%%%%%%%% page splitting and HTML generating %%%%%%%%%%%%%%%%%%%%%%% -->
<xsl:template match="text" mode="page_splitting">
<xsl:variable name="context" select="." />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment