Commit 9cf0e634 authored by thorsten.vitt's avatar thorsten.vitt
Browse files

Made @rendition elements local pointers

parent 17925c4c
......@@ -125,7 +125,7 @@
<div xmlns="http://www.tei-c.org/ns/1.0">
<xsl:if test="@class">
<xsl:attribute name="rendition">
<xsl:value-of select="@class"/>
<xsl:value-of select="string-join(for $token in tokenize(@class, '\s+') return concat('#', $token), ' ')"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@fo.keep-together">
......
......@@ -315,7 +315,7 @@
</xsl:template>
<xsl:template match="@class" mode="#all">
<xsl:attribute name="rendition" select="."/>
<xsl:attribute name="rendition" select="string-join(for $token in tokenize(., '\s+') return concat('#', $token), ' ')"/>
</xsl:template>
<xsl:template match="page/@nr|startpage/@nr" mode="#all"/>
......
......@@ -113,7 +113,7 @@
<!-- ## castList + set (benanntes Template).
Zuerst Gruppen erstellen, die mit h4 anfangen.
Dann in diesen Gruppen weitere Gruppen machen, um castGroup von set zu trennen.
set fängt an mit zentriertem Text (@rendition="zenoPC"), was zur Trennung verwendet wird.
set fängt an mit zentriertem Text (@rendition="#zenoPC"), was zur Trennung verwendet wird.
castGroup wird nur dann erstellt, wenn der aktuelle Kontext nicht mit zentriertem Text
anfängt.
-->
......@@ -135,26 +135,26 @@
<xsl:sequence select="current-group()"/>
</xsl:variable>
<xsl:variable name="all-divs-starting-with-zenopc"
select="if ( $crtGrp/p[@rendition eq 'zenoPC']
select="if ( $crtGrp/p[@rendition eq '#zenoPC']
[not(preceding-sibling::p)]
[following-sibling::
p [not(@rendition eq 'zenoPC')]
[following-sibling::p[@rendition eq 'zenoPC']] ] )
p [not(@rendition eq '#zenoPC')]
[following-sibling::p[@rendition eq '#zenoPC']] ] )
then true
else false"> </xsl:variable>
<xsl:for-each-group select="$crtGrp/node()"
group-starting-with="
p[@rendition eq 'zenoPC']
[not(preceding-sibling::p[1][@rendition eq 'zenoPC'])]
[not(following-sibling::p[1][not(@rendition) or (@rendition ne 'zenoPC')])]">
p[@rendition eq '#zenoPC']
[not(preceding-sibling::p[1][@rendition eq '#zenoPC'])]
[not(following-sibling::p[1][not(@rendition) or (@rendition ne '#zenoPC')])]">
<xsl:choose>
<xsl:when
test="not($all-divs-starting-with-zenopc) and
current-group()[1]
[self::p[@rendition eq 'zenoPC'][not(normalize-space() eq '')]
[not(preceding-sibling::p[1][@rendition eq 'zenoPC'])]
[not(following-sibling::p[1][not(@rendition) or (@rendition ne 'zenoPC')])] ]
[self::p[@rendition eq '#zenoPC'][not(normalize-space() eq '')]
[not(preceding-sibling::p[1][@rendition eq '#zenoPC'])]
[not(following-sibling::p[1][not(@rendition) or (@rendition ne '#zenoPC')])] ]
">
<div type="set" xmlns="http://www.tei-c.org/ns/1.0">
<xsl:apply-templates select="current-group()"
......@@ -163,13 +163,13 @@
</xsl:when>
<xsl:otherwise>
<xsl:for-each-group select="current-group()"
group-starting-with="p[@rendition eq 'zenoPC']
group-starting-with="p[@rendition eq '#zenoPC']
[not(preceding-sibling::p[1][@rendition
eq 'zenoPC'])]">
eq '#zenoPC'])]">
<xsl:choose>
<xsl:when
test="current-group()[self::p[not(@rendition
eq 'zenoPC')] ]">
eq '#zenoPC')] ]">
<castGroup>
<xsl:apply-templates select="current-group()"
mode="cast"/>
......@@ -178,7 +178,7 @@
<xsl:when
test="every $x in
current-group()[self::p] satisfies
$x[@rendition eq 'zenoPC']">
$x[@rendition eq '#zenoPC']">
<div type="set">
<xsl:apply-templates select="current-group()"
mode="#current"/>
......@@ -229,7 +229,7 @@
<!-- ## p innerhalb der Personenliste: -->
<xsl:template match="p" mode="cast">
<xsl:choose>
<xsl:when test="@rendition eq 'zenoPC'"/>
<xsl:when test="@rendition eq '#zenoPC'"/>
<xsl:when test="normalize-space(.) eq ''"> </xsl:when>
<xsl:when test="not(@rendition)">
<castItem n="free-text">
......@@ -431,7 +431,7 @@ nach: <tg_grp TEI="sp">
<!-- <xsl:template
match="div[@tg_step eq 'drama-2']//p[@rendition='zenoPC']/hi[@rend eq 'italic']
match="div[@tg_step eq 'drama-2']//p[@rendition='#zenoPC']/hi[@rend eq 'italic']
|div[not(ancestor::div)][@tg_step eq 'drama-2']//tg_speaker//hi[@rend eq 'italic']">
<xsl:copy>
<xsl:copy-of select="@*"/>
......@@ -440,7 +440,7 @@ nach: <tg_grp TEI="sp">
</xsl:copy>
</xsl:template>-->
<xsl:template
match="div[@type eq 'text']//p[@rendition='zenoPC'][hi[@rend eq 'italics']]
match="div[@type eq 'text']//p[@rendition='#zenoPC'][hi[@rend eq 'italics']]
|div[@type eq 'text']//speaker/p[hi[@rend eq 'italics']]"
mode="drama-3">
<!-- Warum ist in birch-pferiffer xml:id="tg7.2.8.2" keine stage? -->
......@@ -453,7 +453,7 @@ nach: <tg_grp TEI="sp">
</xsl:template>
<!-- <xsl:template
match="div[not(ancestor::div)][@tg_step eq
'drama-3']//p[@rendition='zenoPC'][hi[@rend eq 'italic'][@TEI eq 'stage']][count(*) eq 1][not(text()[normalize-space() ne ''])]">
'drama-3']//p[@rendition='#zenoPC'][hi[@rend eq 'italic'][@TEI eq 'stage']][count(*) eq 1][not(text()[normalize-space() ne ''])]">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="TEI" select="'stage'"/>
......@@ -462,7 +462,7 @@ nach: <tg_grp TEI="sp">
</xsl:template>-->
<xsl:template
match="div[@type eq 'text']//p[@rendition='zenoPC']
match="div[@type eq 'text']//p[@rendition='#zenoPC']
[parent::speaker//hi[@rend eq 'italics'] or hi[@rend eq 'italics']][count(*) eq 1][not(text()[normalize-space() ne ''])]|
div[@type eq 'text']//speaker[p/node()[1][self::text()] or node()[1][self::text()]]/p[hi[@rend eq 'italics']]"
mode="drama-3" priority="1">
......@@ -472,7 +472,7 @@ nach: <tg_grp TEI="sp">
</stage>
</xsl:template>
<!--<!-\- <xsl:template
match="div[@tg_step eq 'drama-2']//p[@rendition='zenoPC']/hi[@rend eq 'italic']
match="div[@tg_step eq 'drama-2']//p[@rendition='#zenoPC']/hi[@rend eq 'italic']
|div[not(ancestor::div)][@tg_step eq 'drama-2']//tg_speaker//hi[@rend eq 'italic']">
<xsl:copy>
<xsl:copy-of select="@*"/>
......@@ -561,10 +561,10 @@ nach: <tg_grp TEI="sp">
<xsl:for-each-group select="node()"
group-starting-with="
(:#1:) lb
(:#2:) |p[@rendition eq 'zenoPC']
(:#3:) |p[starts-with(@rendition,'zenoPR')]
(:#4:) |p[not(normalize-space() eq '')][not(@rendition eq 'zenoPC')][not(stage)][not(starts-with(@rendition,'zenoPR'))]
(:#5:) [not(preceding-sibling::*[1][self::p[not(normalize-space() eq '')][not(@rendition eq 'zenoPC')][not(stage)][not(starts-with(@rendition,'zenoPR'))]])]
(:#2:) |p[@rendition eq '#zenoPC']
(:#3:) |p[starts-with(@rendition,'#zenoPR')]
(:#4:) |p[not(normalize-space() eq '')][not(@rendition eq '#zenoPC')][not(stage)][not(starts-with(@rendition,'#zenoPR'))]
(:#5:) [not(preceding-sibling::*[1][self::p[not(normalize-space() eq '')][not(@rendition eq '#zenoPC')][not(stage)][not(starts-with(@rendition,'#zenoPR'))]])]
(:# #6 und #4 sind gleich. #5 bis #7 bedeuten, dass nur das
erste p, das die Bedingungen unter #4 erfüllt, als Beginn einer Gruppe
......@@ -572,7 +572,7 @@ nach: <tg_grp TEI="sp">
">
<xsl:choose>
<xsl:when
test="current-group()[1][self::p[not(normalize-space() eq '')][not(@rendition eq 'zenoPC')][not(stage)][not(starts-with(@rendition,'zenoPR'))]]
test="current-group()[1][self::p[not(normalize-space() eq '')][not(@rendition eq '#zenoPC')][not(stage)][not(starts-with(@rendition,'#zenoPR'))]]
(:# #9 und #4 sind gleich. Wenn das Erste in der Gruppe
ein p ist (wie unter #4 angegeben), dann einen
lg-Container erzeugen (eigtl. tg_grp), wenn in der
......@@ -648,18 +648,18 @@ nach: <tg_grp TEI="sp">
Eine zu große Alternation von langen und kurzen Zeilen (p und l) soll es nicht geben. Zu viel
oder relativ viel lange Zeilen deuten auf Prosa hin (dann die l zu p machen). -->
<xsl:template match="div[@type eq 'text']" priority="2" mode="drama-4">
<!-- [not(normalize-space() eq '')][not(@rendition eq 'zenoPC')]
[not(*[@TEI eq 'stage'])][not(starts-with(@rendition,'zenoPR'))]"-->
<!-- [not(normalize-space() eq '')][not(@rendition eq '#zenoPC')]
[not(*[@TEI eq 'stage'])][not(starts-with(@rendition,'#zenoPR'))]"-->
<xsl:copy>
<xsl:copy-of select="@*[not(name(.) eq 'tg_step')]"/>
<xsl:variable name="long"
select="count(descendant::p
[string-length(normalize-space()) gt $_verse-max-length_][not(@rendition eq 'zenoPC')][not(starts-with(@rendition,'zenoPR'))]
[string-length(normalize-space()) gt $_verse-max-length_][not(@rendition eq '#zenoPC')][not(starts-with(@rendition,'#zenoPR'))]
)"/>
<xsl:variable name="short"
select="count(descendant::p
[string-length(normalize-space()) lt $_verse-max-length_][not(@rendition eq 'zenoPC')]
[not(stage)][not(starts-with(@rendition,'zenoPR'))]
[string-length(normalize-space()) lt $_verse-max-length_][not(@rendition eq '#zenoPC')]
[not(stage)][not(starts-with(@rendition,'#zenoPR'))]
)"/>
<xsl:variable name="ratio-long"
select="if (($long + $short) gt 0)
......
......@@ -107,9 +107,9 @@
<xsl:when test="matches(.,'^\s*\d+\.?(-\d+)?[\.\)]\D+$')"
>digits-start;</xsl:when>
</xsl:choose>
<xsl:if test="starts-with(@rendition,'zenoPC')">align:center;</xsl:if>
<xsl:if test="starts-with(@rendition,'zenoPR')">align:right;</xsl:if>
<xsl:if test="starts-with(@rendition,'zenoPL')">align:left-indent;</xsl:if>
<xsl:if test="starts-with(@rendition,'#zenoPC')">align:center;</xsl:if>
<xsl:if test="starts-with(@rendition,'#zenoPR')">align:right;</xsl:if>
<xsl:if test="starts-with(@rendition,'#zenoPL')">align:left-indent;</xsl:if>
</xsl:variable>
<xsl:variable name="featuresAsString" select="string-join($features,'')"/>
<xsl:if test="$featuresAsString != ''">
......
......@@ -234,7 +234,7 @@
</serialized>
</options>
</meta>
<projectTree name="newWorkflow.xpr">
<projectTree name="literatur.xpr">
<folder masterFiles="true" name="Master Files">
<file name="2_generateTEI/generateTEI.xsl"/>
<file name="5_genres/genres.xsl"/>
......
Supports Markdown
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