Commit 1197fa06 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

Merge branch 'release/4.6.0'

parents 735fbeba a0cd399e
project.name=http://textgrid.de/ns/SADE-fontane-develop project.name=http://textgrid.de/ns/SADE-fontane-develop
project.version=4.4.0 project.version=4.6.0
project.title=[Fontane] SADE project.title=[Fontane] SADE
project.abbrev=SADE-fontane-develop project.abbrev=SADE-fontane-develop
project.processorversion=4.7.0 project.processorversion=4.7.0
......
...@@ -82,7 +82,10 @@ else if (tokenize($exist:path, '/') = "get") then ...@@ -82,7 +82,10 @@ else if (tokenize($exist:path, '/') = "get") then
serialize($doc/xhtml:body/xhtml:div/xhtml:div[not(@class="teixml")][not(@class="facs")]) serialize($doc/xhtml:body/xhtml:div/xhtml:div[not(@class="teixml")][not(@class="facs")])
=> replace("xhtml:", "") => replace("xhtml:", "")
case "facs.html" return case "facs.html" return
if ($alternative and $id="2128f") (: using one transformation for two renderings :) if ($alternative and $id="2128f")
(: using one transformation for two renderings :)
(: TODO: use this for 18vm7 1r as well
TODO: we are replacing instead of traversing the images :)
then replace(serialize($doc//xhtml:div[@class="facs"]), "xhtml:", "") then replace(serialize($doc//xhtml:div[@class="facs"]), "xhtml:", "")
=> replace("1671z", "16725") => replace("1671z", "16725")
else else
......
...@@ -167,7 +167,11 @@ declare function etTransfo:create-print-tei() as xs:string { ...@@ -167,7 +167,11 @@ declare function etTransfo:create-print-tei() as xs:string {
let $complete-print-file := let $complete-print-file :=
element {QName("http://www.tei-c.org/ns/1.0", "teiCorpus")} { element {QName("http://www.tei-c.org/ns/1.0", "teiCorpus")} {
$xmls, $xmls,
etTransfo:get-literature() try {
etTransfo:get-literature()
} catch * {
error(QName("error", "ETTRANSFO06"), "An error occured while creating the bibliography.")
}
} }
return return
xmldb:store($config:data-root || "/print/xml/", "fontane-full.xml", $complete-print-file) xmldb:store($config:data-root || "/print/xml/", "fontane-full.xml", $complete-print-file)
...@@ -263,21 +267,52 @@ declare function etTransfo:get-literature() as element(tei:div) { ...@@ -263,21 +267,52 @@ declare function etTransfo:get-literature() as element(tei:div) {
: bibliographic reference : bibliographic reference
:) :)
declare function etTransfo:make-bib-entries($type as xs:string) as element(tei:div)* { declare function etTransfo:make-bib-entries($type as xs:string) as element(tei:div)* {
for $entry in doc("/db/sade-projects/textgrid/data/xml/data/25547.xml")//tei:listBibl[@type = $type]/tei:bibl for $entry in doc("/db/sade-projects/textgrid/data/xml/data/25547.xml")//tei:listBibl[@type = $type]//tei:bibl
for $choice in $entry//tei:choice let $abbr :=
let $abbr := $choice//tei:abbr if($entry/tei:abbr) then
let $full-ref := $choice//tei:expan $entry/tei:abbr
else
return $entry/tei:choice/tei:abbr
element {QName("http://www.tei-c.org/ns/1.0", "div")} { let $full-ref := $entry/tei:choice/tei:expan
attribute type {"entry"}, let $bib-no := count($entry/ancestor::tei:bibl)
element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"abbr"}, return
$abbr element {QName("http://www.tei-c.org/ns/1.0", "div")} {
}, attribute type {"entry"},
element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"abbr"},
$abbr
},
if($full-ref) then
element {QName("http://www.tei-c.org/ns/1.0", "seg")} { element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"full"}, attribute type {"full"},
$full-ref $full-ref
} }
}
else if($entry/tei:ptr[@target]) then
let $target-id := replace($entry/tei:ptr/@target, "#", "")
let $referenced-entry := $entry/ancestor::tei:body//tei:bibl[@xml:id = $target-id]
let $same-as := $referenced-entry/tei:choice/tei:abbr/string()
let $same-as-loc := $referenced-entry/ancestor::tei:listBibl[1]/@type/string()
return
(element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"same-as"},
$same-as
},
element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"same-as-loc"},
$same-as-loc
})
else
(),
if($bib-no gt 0) then
element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"sub-entry"},
$bib-no
}
else
()
}
}; };
...@@ -58,8 +58,12 @@ declare function prepCom:recursion($nodes as node()*) as node()* { ...@@ -58,8 +58,12 @@ declare function prepCom:recursion($nodes as node()*) as node()* {
typeswitch ($node) typeswitch ($node)
case text() return case text() return
$node $node
case comment() return case comment() return
() if(matches($node/string(), "rotate")) then
$node
else
()
(: in case of figures the text in the tei:figDesc serves as editorial (: in case of figures the text in the tei:figDesc serves as editorial
commentary - there's no tei:note referring to it. thus we set a commentary - there's no tei:note referring to it. thus we set a
...@@ -204,7 +208,10 @@ declare function prepCom:find-literature($nodes as node()*) as node()* { ...@@ -204,7 +208,10 @@ declare function prepCom:find-literature($nodes as node()*) as node()* {
case text() return case text() return
$node $node
case comment() return case comment() return
() if(matches($node/string(), "rotate")) then
$node
else
()
case element(tei:ptr) return case element(tei:ptr) return
if($node[ancestor::tei:note[@type = "editorial"]]) then if($node[ancestor::tei:note[@type = "editorial"]]) then
......
...@@ -24,7 +24,10 @@ declare function presort:prepare($nodes as node()*) as node()* { ...@@ -24,7 +24,10 @@ declare function presort:prepare($nodes as node()*) as node()* {
$node $node
case comment() return case comment() return
() if(matches($node/string(), "rotate")) then
$node
else
()
default return default return
if($node/preceding-sibling::*[self::tei:addSpan][1][@place = 'interlinear'][@prev or @next] if($node/preceding-sibling::*[self::tei:addSpan][1][@place = 'interlinear'][@prev or @next]
......
...@@ -44,35 +44,49 @@ declare function fsort:sort($nodes as node()*) { ...@@ -44,35 +44,49 @@ declare function fsort:sort($nodes as node()*) {
case text() return case text() return
$node $node
case element(tei:hi) return case comment() return
if($node/@next and not($node/ancestor::tei:rs)) then if(matches($node, "transform")) then
let $corresp-node := fsort:find-corresp-node($node, "next") $node
return
(: it's not sufficient to copy only the corresp node since
this would mean we'd loose the information about the tei:rs :)
if($corresp-node[self::tei:hi and parent::tei:rs]) then
(fsort:keep-node($node),
element {QName("http://www.tei-c.org/ns/1.0", "rs")} {
$corresp-node/parent::*/@*,
$corresp-node
})
else
fsort:default-return($node)
else else
fsort:default-return($node)
case element(tei:rs) return
(: in this case the tei:rs is empty after fsort:apply-all-nexts. we
don't need these. :)
if($node[child::*[@prev]] and count($node/child::*) = 1) then
() ()
else
fsort:default-return($node)
case element(tei:zone) return
fsort:default-return($node)
(: case element(tei:hi) return:)
(: if($node/@next and not($node/ancestor::tei:rs)) then:)
(: let $corresp-node := fsort:find-corresp-node($node, "next"):)
(: return:)
(: (: it's not sufficient to copy only the corresp node since:)
(: this would mean we'd loose the information about the tei:rs :):)
(: if($corresp-node[self::tei:hi and parent::tei:rs]) then:)
(: (fsort:keep-node($node),:)
(: element {QName("http://www.tei-c.org/ns/1.0", "rs")} {:)
(: $corresp-node/parent::*/@*,:)
(: $corresp-node:)
(: }):)
(: else:)
(: fsort:default-return($node):)
(: else:)
(: fsort:default-return($node):)
(::)
(::)
(: case element(tei:rs) return:)
(: (: in this case the tei:rs is empty after fsort:apply-all-nexts. we:)
(: don't need these. :):)
(: if($node[child::*[@prev]] and count($node/child::*) = 1) then:)
(: ():)
(: else:)
(: fsort:default-return($node):)
(: :)
(: case element(tei:date) return:)
(: fsort:keep-node($node):)
(::)
(: case element(tei:ref) return:)
(: fsort:keep-node($node):)
default return default return
fsort:default-return($node) fsort:keep-node($node)
}; };
(:~ (:~
......
...@@ -146,7 +146,7 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a ...@@ -146,7 +146,7 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
else if($node/@cause = "unclear") then else if($node/@cause = "unclear") then
() ()
else if($node[matches(@copyOf, $node/preceding::tei:seg/@xml:id)]) then else if($node[replace($node/@copyOf, "#", "") = $node/ancestor::tei:TEI//tei:seg/@xml:id]) then
fontaneSimple:mark-intervention($node, $uri) fontaneSimple:mark-intervention($node, $uri)
else if($node/@cause ="catchword") then else if($node/@cause ="catchword") then
...@@ -683,12 +683,28 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a ...@@ -683,12 +683,28 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
replace($img-url, ",1000", ",500") replace($img-url, ",1000", ",500")
else else
$img-url $img-url
let $rotation :=
(: no children and comment right after element:)
if($node/following-sibling::node()[1][self::comment()][matches(./string(), "rotate")]
and not($node/child::*)) then
substring-after($node/following::comment()[1], "rotate(")
=> substring-before("deg")
(: comment as first descendant :)
else if($node/child::node()[1][self::comment()][matches(./string(), "rotate")]) then
substring-after($node/child::comment()[1], "rotate(")
=> substring-before("deg")
else
()
return return
element {QName("http://www.tei-c.org/ns/1.0", $node/name())}{ element {QName("http://www.tei-c.org/ns/1.0", $node/name())}{
$node/@*, $node/@*,
attribute position {$display}, attribute position {$display},
attribute href {$img-url}, attribute href {$img-url},
if($rotation) then
attribute rotate {$rotation}
else
(),
fontaneSimple:transform($node/node(), $uri) fontaneSimple:transform($node/node(), $uri)
} }
else else
...@@ -807,6 +823,9 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a ...@@ -807,6 +823,9 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
case element (tei:bibl) return case element (tei:bibl) return
fontaneSimple:copy-element($node, $uri) fontaneSimple:copy-element($node, $uri)
case element(tei:unclear) return
fontaneSimple:copy-element($node, $uri)
default return default return
fontaneSimple:transform($node/node(), $uri) fontaneSimple:transform($node/node(), $uri)
}; };
...@@ -942,7 +961,8 @@ as element(tei:milestone) { ...@@ -942,7 +961,8 @@ as element(tei:milestone) {
let $whitespace-after := let $whitespace-after :=
if($node/following::node()[1][normalize-space(.) = ""] if($node/following::node()[1][normalize-space(.) = ""]
and not($node/following::*[1][@type = "heading"])) then and not($node/following::*[1][@type = "heading"])
and not($node/following::text()[1][matches(substring(., 1, 1), "[\.,]")])) then
true() true()
else else
false() false()
...@@ -1146,13 +1166,14 @@ declare function fontaneSimple:make-key($regular-name as xs:string?) { ...@@ -1146,13 +1166,14 @@ declare function fontaneSimple:make-key($regular-name as xs:string?) {
let $affix := substring-after($regular-name, ".") let $affix := substring-after($regular-name, ".")
let $key := let $key :=
replace($name, "Ä", "A") replace($name, "Ä", "A")
=> replace("ä", "a") => replace("ä", "ae")
=> replace("Ö", "O") => replace("Ö", "Oe")
=> replace("ö", "o") => replace("ö", "oe")
=> replace("Ü", "U") => replace("Ü", "Ue")
=> replace("ü", "u") => replace("ü", "ue")
=> replace(" ", "") => replace(" ", "")
=> replace("\.", "") => replace("\.", "")
=> replace(",", "")
return return
(: sorts terms with a trailer, e.g. 'Friederich II. von Sachsen' after the ones (: sorts terms with a trailer, e.g. 'Friederich II. von Sachsen' after the ones
without, e.g. 'Friederich II.' :) without, e.g. 'Friederich II.' :)
......
...@@ -582,7 +582,7 @@ if(request:get-parameter-names() = 'page') ...@@ -582,7 +582,7 @@ if(request:get-parameter-names() = 'page')
let $page := if($page = '') then 'outer_front_cover' else $page let $page := if($page = '') then 'outer_front_cover' else $page
let $indexFile := doc('/db/sade-projects/textgrid/data/xml/xhtml/' || $uri || "/toc.xml" ) let $indexFile := doc('/db/sade-projects/textgrid/data/xml/xhtml/' || $uri || "/toc.xml" )
let $pageList2 := $indexFile//@data-page/string() let $pageList2 := $indexFile//@data-page/string()
let $index2 := index-of($pageList2, $page) let $index2 := (index-of($pageList2, $page))[1]
let $return := let $return :=
( (
( (
......
...@@ -56,6 +56,6 @@ declare function f-render:edited-text($node as node(), $model as map(), $id as x ...@@ -56,6 +56,6 @@ declare function f-render:edited-text($node as node(), $model as map(), $id as x
let $file := substring-after($id, "data/") => substring-before(".xml") let $file := substring-after($id, "data/") => substring-before(".xml")
return return
<xhtml:div> <xhtml:div>
{doc("/db/apps/SADE/resources/xhtml/" || $file || ".html")} {doc("/db/sade-projects/textgrid/data/xml/print/xhtml/" || $file || ".html")}
</xhtml:div> </xhtml:div>
}; };
...@@ -31,7 +31,7 @@ import module namespace config="http://textgrid.de/ns/SADE/config" at "../config ...@@ -31,7 +31,7 @@ import module namespace config="http://textgrid.de/ns/SADE/config" at "../config
import module namespace index="https://fontane-nb.dariah.eu/indexapi" at "index-api.xqm"; import module namespace index="https://fontane-nb.dariah.eu/indexapi" at "index-api.xqm";
import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "misc.xqm"; import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "misc.xqm";
declare variable $transfo:tooltipReplacementPattern := '\s$|,$|\.|\($|\)$|;|&#x2003;|\[\d+\]$|^Wohn⸗|^ſonder-|^\(|Landſchaften$|^Oelbil'; declare variable $transfo:tooltipReplacementPattern := '\s$|,$|\.|\($|\)$|;|&#x2003;|\[\d+\]$|^Wohn⸗|^ſonder-|^\(|Landſchaften$|^Oelbil|^Schwedens|Schwedens$';
declare variable $transfo:dataCollection := collection("/db/sade-projects/textgrid/data/xml/data"); declare variable $transfo:dataCollection := collection("/db/sade-projects/textgrid/data/xml/data");
...@@ -278,7 +278,8 @@ attribute class { ...@@ -278,7 +278,8 @@ attribute class {
(if($n/@subtype) then string($n/@subtype) else ()), (if($n/@subtype) then string($n/@subtype) else ()),
if( string($n/@subtype)="Kalenderblatt") then if(ends-with($n/@n, 'v')) then 'verso' else 'recto' else (), if( string($n/@subtype)="Kalenderblatt") then if(ends-with($n/@n, 'v')) then 'verso' else 'recto' else (),
if( $n/parent::tei:surface ) then "nested" else (), if( $n/parent::tei:surface ) then "nested" else (),
if( not($n//tei:line[ancestor::tei:zone[@rotate = 180]]) or string($n/@subtype)="Kalenderblatt") then () else "rotate" if( not($n//tei:line[ancestor::tei:zone[@rotate = 180]]) or string($n/@subtype)="Kalenderblatt") then () else "rotate",
$n/@rend ! string(.)
}, },
(: dont call it a label (bootstrap) :) (: dont call it a label (bootstrap) :)
(if($n/@n) then attribute id {"s" || $n/@n} else()), (if($n/@n) then attribute id {"s" || $n/@n} else()),
...@@ -351,12 +352,13 @@ attribute class { ...@@ -351,12 +352,13 @@ attribute class {
'zone', 'zone',
string($n/@type), string($n/@type),
string($n/@subtype), string($n/@subtype),
if (exists($n/preceding-sibling::tei:addSpan) and $n/preceding-sibling::tei:addSpan/substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id ) then 'addSpan' else(), if (exists($n/preceding-sibling::tei:addSpan) and $n/preceding-sibling::tei:addSpan/substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id ) then 'addSpan' else (),
if (exists($n/child::tei:mod[@seq]) (: mod sequence #1 :)
and let $mod := ($n/preceding::tei:mod[@seq][parent::tei:zone][substring-after(@spanTo, '#') = $n/following::tei:anchor/string(@xml:id)], $n/tei:mod[@seq])
$n/child::tei:mod[@seq]/substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id return
) if ($mod)
then 'mod-seq-' || string($n/child::tei:mod[@seq][substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id]/@seq) else(), then 'mod-seq-' || $mod/@seq
else (),
if ($n/@type="illustration") then 'figure' else(), if ($n/@type="illustration") then 'figure' else(),
transfo:segStyle($n), transfo:segStyle($n),
if( $n/@type="illustration" and $n/parent::tei:line) then "verticalMiddel" else (), if( $n/@type="illustration" and $n/parent::tei:line) then "verticalMiddel" else (),
...@@ -415,8 +417,8 @@ attribute style { ...@@ -415,8 +417,8 @@ attribute style {
transfo:lineHeight($n), transfo:lineHeight($n),
(: look 4 TILE objects :) (: look 4 TILE objects :)
if ($n/tei:seg/tei:rs/tei:figure[@xml:id] or $n/tei:figure[@xml:id]) then if ($n/tei:seg/tei:rs/tei:figure[@xml:id] or $n/tei:figure[@xml:id]) then
let $id := string($n//tei:figure/@xml:id) let $id := string($n/tei:figure/@xml:id)
let $uri := string($n/ancestor::tei:TEI//tei:idno[@type="TextGrid"]) let $uri := string($n/root()//tei:idno[@type="TextGrid"])
let $link := transfo:newestTBLELink($uri, $id) let $link := transfo:newestTBLELink($uri, $id)
let $shape := $link/substring-before(substring-after(@targets, '#'), ' ') let $shape := $link/substring-before(substring-after(@targets, '#'), ' ')
...@@ -507,7 +509,7 @@ declare function transfo:line($node as element(tei:line)) { ...@@ -507,7 +509,7 @@ declare function transfo:line($node as element(tei:line)) {
(if($node//text()[not(parent::tei:fw)]) then () else ('height:0.6cm;')), (if($node//text()[not(parent::tei:fw)]) then () else ('height:0.6cm;')),
( (: line-height given in div.zone[style] has no effect wheren large rendering is needed :) ( (: line-height given in div.zone[style] has no effect wheren large rendering is needed :)
if($node//*[contains(string(@style), 'large')] or $node//ancestor::tei:zone[contains(string(@style), 'large')]) if($node//*[contains(string(@style), 'large')] or $node//ancestor::tei:zone[contains(string(@style), 'large')])
then replace( transfo:lineHeight($node/parent::tei:zone), 'line-height', 'max-height') then replace( transfo:lineHeight($node/ancestor::tei:zone[1]), 'line-height', 'max-height')
else ()) else ())
), ';') ), ';')
}, },
...@@ -555,6 +557,12 @@ declare function transfo:seg($node as element(tei:seg)) { ...@@ -555,6 +557,12 @@ declare function transfo:seg($node as element(tei:seg)) {
element xhtml:div { element xhtml:div {
attribute class {'segHover italic'}, attribute class {'segHover italic'},
'Unterführung'} 'Unterführung'}
else (),
if(contains($node/@rend, "underline-cancel"))
then
element xhtml:div {
attribute class {'segHover italic'},
'Unterstreichung zurückgenommen'}
else () else ()
} }
}; };
...@@ -565,7 +573,7 @@ declare function transfo:seg($node as element(tei:seg)) { ...@@ -565,7 +573,7 @@ declare function transfo:seg($node as element(tei:seg)) {
: or @rend or to calculate line-height. : or @rend or to calculate line-height.
:) :)
declare function transfo:segStyle($node) { declare function transfo:segStyle($node) {
let $style := $node/@style let $style := $node/@style || (if(not($node/@style) and $node/@rend and $node/parent::*/@style) then (" " || $node/parent::*/@style) else ())
let $rend := $node/@rend let $rend := $node/@rend
let $type:= if(($node/local-name() = ("seg", "zone")) and ($node/@type = "cancel")) let $type:= if(($node/local-name() = ("seg", "zone")) and ($node/@type = "cancel"))
then then
...@@ -606,7 +614,7 @@ let $medium := if (tokenize($preMedium, " ") = ('blue_pencil', 'violet_pencil', ...@@ -606,7 +614,7 @@ let $medium := if (tokenize($preMedium, " ") = ('blue_pencil', 'violet_pencil',
let $test:= if($seq = ()) then ('TODO', $medium) else ($seq, $rendSeq, $medium, $type, $noLineThroughInCaseOfDeletionViaMetamark) let $test:= if($seq = ()) then ('TODO', $medium) else ($seq, $rendSeq, $medium, $type, $noLineThroughInCaseOfDeletionViaMetamark)
return return
$test ! replace(replace(., '/', '_'), '3_4', 'd3_4') $test ! replace(replace(replace(., '/', '_'), '3_4', 'd3_4'), '\s(\d|\-)', ' d$1')
}; };
declare function transfo:mod($node as element(tei:mod)) declare function transfo:mod($node as element(tei:mod))
...@@ -621,7 +629,16 @@ as element(xhtml:span) { ...@@ -621,7 +629,16 @@ as element(xhtml:span) {
if(local:modTest($node)) then 'addSesquipedalian' else () if(local:modTest($node)) then 'addSesquipedalian' else ()
}, },
if($node/@style and not($node/@seq)) then $node/@style else (), if($node/@style and not($node/@seq)) then $node/@style else (),
if($node//del[@rend='overwritten']) then if($node//*/@corresp = "#C01_4r_c")
then element xhtml:div { attribute class { 'modHover italic'},
element xhtml:span {'d'},
'<',
element xhtml:span {'in'},
' überschrieben ',
element xhtml:span {'urch'},
'>'
}
else if($node//del[@rend='overwritten']) then
element xhtml:div { element xhtml:div {
attribute class { attribute class {
'modHover italic', 'modHover italic',
...@@ -640,10 +657,11 @@ as element(xhtml:span) { ...@@ -640,10 +657,11 @@ as element(xhtml:span) {
else transfo:magic($node/tei:del/node())//text()[. != "unsichere Lesart"][not(contains(string-join(ancestor::*/@class), "expan"))], else transfo:magic($node/tei:del/node())//text()[. != "unsichere Lesart"][not(contains(string-join(ancestor::*/@class), "expan"))],
(if ($node/tei:del/tei:gap) then transfo:magic($node/tei:del/tei:gap) else ()) (if ($node/tei:del/tei:gap) then transfo:magic($node/tei:del/tei:gap) else ())
}, },
if($node/tei:del/tei:gap[@unit='mm'][@reason='illegible']) then 'unentziffert' else (),
' überschrieben ', ' überschrieben ',
element xhtml:span { element xhtml:span {
(: todo: remove decendant::tei:add since it results from a coding error (mod without direkt add) :) (: todo: remove decendant::tei:add since it results from a coding error (mod without direkt add) :)
string-join(($node//tei:add//text()[not(parent::tei:expan)])) string-join(($node//tei:add//text()[not(parent::tei:expan)][not(parent::tei:del)]))
}, },
'>', if(matches(string-join($node//tei:add/text()), '^\.$|^,$|^:$|^;$')) then () else element xhtml:span { transfo:postText($node) } '>', if(matches(string-join($node//tei:add/text()), '^\.$|^,$|^:$|^;$')) then () else element xhtml:span { transfo:postText($node) }
} }
...@@ -661,14 +679,36 @@ as element(xhtml:span) { ...@@ -661,14 +679,36 @@ as element(xhtml:span) {
else else
if($node/@next and contains(string-join($node/root()//tei:mod[@xml:id = substring-after($node/@next, "#")]//@rend), 'caret') ) if($node/@next and contains(string-join($node/root()//tei:mod[@xml:id = substring-after($node/@next, "#")]//@rend), 'caret') )
then 'mit Einweisungszeichen' then 'mit Einweisungszeichen'
else
if( not(exists($node//tei:add[not(tei:del)])) )
then 'durchgestrichen'
else ()
)
}
else if($node//tei:add and not($node//tei:del))
then
element xhtml:div {
attribute class {
'modHover italic',
if($node/ancestor::tei:*/@rotate or $node/ancestor::tei:zone/preceding-sibling::tei:addSpan) then () else 'hoverTop'},
('Hinzufügung',
if( contains(string-join($node//@rend), 'caret') )
then 'mit Einweisungszeichen'
else
if($node/@next and $node/@next and contains(string-join($node/root()//tei:mod[@xml:id = substring-after($node/@next, "#")]//@rend), 'caret') )
then 'mit Einweisungszeichen'
else () else ()
) )
} }
else (), else (),
if($node/tei:del[@rend eq "overwritten"]) if($node/tei:del[@rend eq "overwritten"])
then then
(transfo:magic($node/tei:add), (
transfo:magic($node/tei:del)) transfo:magic($node/node()[. << $node/tei:add[1]][. << $node/tei:del[1]]),
transfo:magic($node/tei:add),
transfo:magic($node/tei:del),
transfo:magic($node/node()[. >> $node/tei:add[last()]][. >> $node/tei:del[last()]])
)
else transfo:magic($node/node()) else transfo:magic($node/node())
} }
}; };
...@@ -756,14 +796,19 @@ if ($node/@place = ('above', 'below')) then ( ...@@ -756,14 +796,19 @@ if ($node/@place = ('above', 'below')) then (
if(contains($node/@rend, '3/4-circle')) then 'threequatercircle' else (), if(contains($node/@rend, '3/4-circle')) then 'threequatercircle' else (),
if(contains($node/@rend, 'semicircle(bottom)')) then 'semicircle bottom' else (), if(contains($node/@rend, 'semicircle(bottom)')) then 'semicircle bottom' else (),
if(contains($node/@rend, 'semicircle(left)')) then 'semicircle left' else (), if(contains($node/@rend, 'semicircle(left)')) then 'semicircle left' else (),
if(contains($node/@rend, 'semicircle(right)')) then 'semicircle right' else () if(contains($node/@rend, 'semicircle(right)')) then 'semicircle right' else (),
if(contains($node/@rend, 'caret:looped_arc')) then 'looped_arc' else ()
}, },
if($style = () ) then () else attribute style {$style}, if($style = () ) then () else attribute style {$style},
if($node/@rend="caret:looped_arc(pos-left)") if($node/@rend="caret:looped_arc(pos-left)")
then <xhtml:img src="/public/img/caret:looped-arc-pos-left.svg" width="140px" height="auto" style="left: -0.7cm; position: absolute;"/> then <xhtml:img src="/public/img/caret:looped-arc-pos-left.svg" width="140px" height="auto" style="left: -0.7cm; position: absolute;"/>
else (), else (),
transfo:magic($node/node()), transfo:magic($node/node()),
if(not($node/ancestor::tei:mod) and not( $node/@copyOf ) and not( $node/tei:seg[@type="multiphrase"] ) ) then if(
not($node/ancestor::tei:mod)
and not( $node/@copyOf )
and not( $node/tei:seg[@type="multiphrase"] or $node/ancestor::tei:seg[@type="multiphrase"] ) )
then
element xhtml:div { element xhtml:div {
attribute class {'addHover italic'}, attribute class {'addHover italic'},
'Hinzufügung', 'Hinzufügung',
...@@ -961,7 +1006,7 @@ as element(xhtml:space) { ...@@ -961,7 +1006,7 @@ as element(xhtml:space) {
then then
element xhtml:div { element xhtml:div {
attribute class {'spaceHover'}, attribute class {'spaceHover'},
'Platzhalter Namen' 'Platzhalter'
} }
else () else ()
}