Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apparatus refactoring #308

Merged
merged 33 commits into from
Aug 9, 2019
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cacaed6
replace "..." with „...“ in quotations
jakosch Jul 13, 2019
fae2e0c
enquote template und Funktion für Apparat und Incipit
jakosch Jul 15, 2019
9318e26
fix wega:enquote() to cope with arbitrary input
peterstadler Jul 15, 2019
5bd86a1
some refactoring
peterstadler Jul 15, 2019
73bfa05
force named template to stick to the current mode
peterstadler Jul 15, 2019
a4816cd
updates regarding the new enquote policy
peterstadler Jul 15, 2019
62c427b
update expected results (part 1)
peterstadler Jul 15, 2019
11b618b
update expected results (part 2)
peterstadler Jul 15, 2019
5612dec
tei_lemma styling for popover and apparatus (#302)
jakosch Jul 15, 2019
71a8a31
update mode for processing of lemmas
peterstadler Jul 15, 2019
3dbf04e
update expected results
peterstadler Jul 15, 2019
e4986ef
re: shorten lemmas (#303)
jakosch Jul 16, 2019
5ee690d
Merge branch 'issue-302-fix-enquotes' into issue-302
peterstadler Jul 18, 2019
d0016d5
refactor processing to use one dedicated template
peterstadler Jul 18, 2019
0806287
make the 'sic' version the default
peterstadler Jul 18, 2019
3777509
process quotations etc. in every mode
peterstadler Jul 18, 2019
dddaf52
suppress empty quotation marks
peterstadler Jul 18, 2019
a6d3f91
remove old commented code
peterstadler Jul 18, 2019
d56cc03
fix duplicate output of tei:gap in apparatus
peterstadler Jul 18, 2019
27295a5
display tei:gap in lemmata
peterstadler Jul 18, 2019
a701845
add rend='erased' to processing of tei:del
peterstadler Jul 19, 2019
f54bbae
remove whitespace and full stops and add delErased
peterstadler Jul 19, 2019
92cbe24
update expected results
peterstadler Jul 19, 2019
fbbd449
lemmata styling
jakosch Jul 19, 2019
94120d5
fix css rule
jakosch Jul 19, 2019
4a3a11f
enquote rdg
jakosch Jul 21, 2019
c2ccc79
re #308: source attribution
jakosch Jul 29, 2019
4a281bc
fix rdg lemma, removed note count in apparatus
jakosch Jul 30, 2019
b1dfb60
prevent unintended witness output
jakosch Aug 3, 2019
7430181
postpone inclusion of listWit
peterstadler Aug 9, 2019
6a4b838
restructure sections to hide empty contents
peterstadler Aug 9, 2019
ac4577f
refactor tei:app sections
peterstadler Aug 9, 2019
51b12ec
update expected results
peterstadler Aug 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updates regarding the new enquote policy
  • Loading branch information
peterstadler committed Jul 15, 2019
commit a4816cd48e00774cd822ff6ef89e4c43696a3a01
74 changes: 44 additions & 30 deletions xsl/apparatus.xsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wega="http://xquery.weber-gesamtausgabe.de/webapp/functions/utilities" exclude-result-prefixes="xs" version="2.0">
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wega="http://xquery.weber-gesamtausgabe.de/webapp/functions/utilities"
exclude-result-prefixes="xs" version="2.0">

<xsl:template name="createApparatus">
<xsl:variable name="textConstitutionPath" select=".//tei:subst | .//tei:add[not(parent::tei:subst)] | .//tei:gap[not(@reason='outOfScope')] | .//tei:sic[not(parent::tei:choice)] | .//tei:del[not(parent::tei:subst)] | .//tei:unclear[not(parent::tei:choice)] | .//tei:note[@type='textConst']"/>
Expand Down Expand Up @@ -78,21 +83,21 @@
<xsl:variable name="vtextPreNote" select="//tei:note[@xml:id=$noteID]/preceding::text()"/>
<xsl:variable name="textTokensBetween" select="tokenize(string-join($vtextPostPtr[count(.|$vtextPreNote) = count($vtextPreNote)], ' '), '\s+')"/>
<xsl:variable name="qelem">
<xsl:element name="span">
<xsl:attribute name="class" select="'tei_lemma'"/>
<xsl:choose>
<xsl:when test="count($textTokensBetween) gt 6">
<xsl:value-of select="string-join(subsequence($textTokensBetween, 1, 3), ' ')"/>
<xsl:text> … </xsl:text>
<xsl:value-of select="string-join(subsequence($textTokensBetween, count($textTokensBetween) -2, 3), ' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-join($textTokensBetween, ' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:choose>
<xsl:when test="count($textTokensBetween) gt 6">
<xsl:value-of select="string-join(subsequence($textTokensBetween, 1, 3), ' ')"/>
<xsl:text> … </xsl:text>
<xsl:value-of select="string-join(subsequence($textTokensBetween, count($textTokensBetween) -2, 3), ' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-join($textTokensBetween, ' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="wega:enquote($qelem)"/>
<xsl:element name="span">
<xsl:attribute name="class" select="'tei_lemma'"/>
<xsl:value-of select="wega:enquote($qelem)"/>
</xsl:element>
<xsl:text>: </xsl:text>
</xsl:template>

Expand Down Expand Up @@ -127,14 +132,17 @@
<xsl:value-of select="wega:getLanguageString('subst',$lang)"/>
</xsl:attribute>
<!-- Need to take care of whitespace when there are multiple <add> -->
<xsl:choose>
<xsl:when test="count(tei:add) gt 1">
<xsl:apply-templates select="wega:enquote(tei:add) | text()" mode="plain-text-output"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="wega:enquote(tei:add)" mode="plain-text-output"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="qelem">
<xsl:choose>
<xsl:when test="count(tei:add) gt 1">
<xsl:apply-templates select="tei:add | text()" mode="plain-text-output"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="tei:add" mode="plain-text-output"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="wega:enquote($qelem)"/>
<xsl:text>: </xsl:text>
<xsl:choose>
<xsl:when test="./tei:del/tei:gap">
Expand Down Expand Up @@ -406,10 +414,10 @@
<xsl:choose>
<xsl:when test="tei:sic">
<xsl:text>recte </xsl:text>
<xsl:value-of select="wega:enquote(tei:corr)"/>
<xsl:value-of select="wega:enquote(normalize-space(tei:corr))"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="concat(wega:getLanguageString('choiceCorr', $lang),' ')"/>
<xsl:value-of select="wega:enquote(tei:sic)">
<xsl:value-of select="wega:enquote(normalize-space(tei:sic))">
</xsl:value-of>
</xsl:when>
<xsl:when test="tei:unclear">
Expand All @@ -426,10 +434,10 @@
<xsl:value-of select="wega:enquote(subsequence($opts, 2))"/>
</xsl:when>
<xsl:when test="tei:abbr">
<xsl:value-of select="wega:enquote(tei:abbr)"/>
<xsl:value-of select="wega:enquote(normalize-space(tei:abbr))"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="concat(wega:getLanguageString('choiceAbbr', $lang),' ')"/>
<xsl:value-of select="wega:enquote(tei:expan)"/>
<xsl:value-of select="wega:enquote(normalize-space(tei:expan))"/>
</xsl:when>
</xsl:choose>
</xsl:element>
Expand Down Expand Up @@ -457,9 +465,15 @@
<xsl:element name="span">
<xsl:attribute name="class" select="concat('tei_', local-name())"/>
<xsl:attribute name="id" select="wega:createID(.)"/>
<xsl:element name="span"><xsl:attribute name="class">brackets_supplied</xsl:attribute><xsl:text>[</xsl:text></xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">brackets_supplied</xsl:attribute>
<xsl:text>[</xsl:text>
</xsl:element>
<xsl:apply-templates mode="#current"/>
<xsl:element name="span"><xsl:attribute name="class">brackets_supplied</xsl:attribute><xsl:text>]</xsl:text></xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">brackets_supplied</xsl:attribute>
<xsl:text>]</xsl:text>
</xsl:element>
</xsl:element>
</xsl:template>

Expand Down Expand Up @@ -495,7 +509,7 @@
<xsl:attribute name="data-title">
<xsl:value-of select="wega:getLanguageString('del',$lang)"/>
</xsl:attribute>
<xsl:call-template name="enquote"/>
<xsl:value-of select="wega:enquote(normalize-space(.))"/>
<xsl:text>: </xsl:text>
<xsl:choose>
<xsl:when test="tei:gap">
Expand Down