Commit f0f2a121 authored by mrodzis's avatar mrodzis 🌎
Browse files

Improve whitespace handling, rename resource

parent 37a55dfd
......@@ -49,7 +49,7 @@ declare function fontaneSimple:main($file as xs:string) as node()? {
<back>{fontaneSimple:transform($back-covers)}</back>
</text>
</TEI>
let $store := xmldb:store("/db/apps/SADE/resources/xml/", "tei-simple-pre.xml", $tei)
let $store := xmldb:store("/db/apps/SADE/resources/xml/", "fontane-tei-tmp.xml", $tei)
return $tei
};
......@@ -76,7 +76,11 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
or $node/ancestor::tei:figDesc
or $node/ancestor::tei:desc[@type = "edited_text"]
or $node/ancestor::tei:note[@type = "editorial"]) then
simpleHelpers:prepare-text($node)
if($node/parent::tei:rs and starts-with($node, " ")
and not($node/preceding-sibling::*[1][self::tei:handShift])) then
simpleHelpers:prepare-text(text{substring-after($node, " ")})
else
simpleHelpers:prepare-text($node)
else
()
......@@ -121,7 +125,7 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
fontaneSimple:transform($node/node())
case element(tei:add) return
if($node/@type = "edited_text"
(if($node/@type = "edited_text"
or $node/child::tei:seg[@type = "multiphrase"]) then
fontaneSimple:copy-element($node)
(: :)
......@@ -152,7 +156,8 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
fontaneSimple:transform($node/node()))
else
fontaneSimple:transform($node/node())
fontaneSimple:transform($node/node()),
text{" "})
case element(tei:addSpan) return
if($node/@type = "edited_text") then
......@@ -645,11 +650,12 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
case element(tei:rs) return
let $index-type := substring-before($node/@ref, ":")
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/@*,
fontaneSimple:make-index-infos($node, $index-type),
fontaneSimple:transform($node/node())
}
},
text{" "})
case element(tei:date) return
element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
......
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