Commit 281c1504 authored by mrodzis's avatar mrodzis 🌎
Browse files

Merge branch 'feature/#97-#98-multiphrase-paragraphs' into 'develop'

Implement multiphrase, paragraph lines, verses, fractions in edited text

Closes #98 and #97

See merge request !36
parents c07b53c8 0ee9d2e9
......@@ -77,6 +77,29 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
simple2xhtml:recursion($node/node())
})
case element(tei:add) return
if($node/@place = "above"
and $node/preceding-sibling::*[1][self::tei:seg[@type = "multiphrase"]]) then
let $corresp-id := replace($node/@corresp, "#", "")
let $corresp-anchor := $node/root()//tei:anchor[@xml:id = $corresp-id]
let $corresp-seg := $corresp-anchor/ancestor::tei:seg[@type = 'multiphrase']
let $super := $node/root()//tei:seg[@type = "multiphrase"][@xml:id = replace($corresp-seg/@corresp, "#", "")]
let $sub := $corresp-seg
return
element xhtml:span {
simple2xhtml:set-hs-info($node, "multiphrase"),
element xhtml:span {
attribute class {"multiphrase-top"},
simple2xhtml:recursion($super/node())
},
element xhtml:span {
attribute class {"multiphrase-bottom"},
simple2xhtml:recursion($sub/node())
}
}
else
simple2xhtml:recursion($node/node())
case element(tei:div) return
if($node/@type = "toc") then
if($node/@subtype = "Friedrich_Fontane") then
......@@ -228,8 +251,20 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
else
text{" "}
else if($node/@unit = "start-lg") then
let $lines := $node/following-sibling::tei:l[. << $node/following-sibling::tei:milestone[@unit = "end-lg"][1]]
return
element xhtml:div {
attribute class {"nb-verses"},
for $line in $lines return
element xhtml:div {
attribute class {"nb-verse"},
simple2xhtml:recursion($line/node())
}
}
else if($node/@unit = "paragraph") then
(element xhtml:br{},
(element xhtml:br {},
element xhtml:div {
attribute class {"nb-paragraph"}
})
......@@ -237,6 +272,12 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
else
()
(: lines are handled together with tei:milestone[@unit = "start-lg"]. all
other verses are ignored. :)
case element(tei:l) return
()
case element(tei:ab) return
if($node/@type = "sketch"
and $node/descendant::tei:figure) then
......@@ -250,6 +291,11 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
else if($node/@type = ("caret", "footnote-mark")) then
()
else if($node/@type = "short-paragraph-line") then
element xhtml:div {
attribute class {$node/@type}
}
else if($node/@type = "paragraph" and $node/string = "z") then
(element xhtml:br{},
element xhtml:div {
......@@ -287,10 +333,14 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
())
case element(tei:seg) return
if($node/@type = "caption") then
if($node/@type = ("caption", "editorial-label", "multiphrase")) then
()
else if($node/@type = "editorial-label") then
else if($node[@rendition = ("vertical-align:super", "vertical-align:sub")
and
(following-sibling::*[1][self::tei:g[@ref ="#hb"]]
or preceding-sibling::*[1][self::tei:g[@ref ="#hb"]])
]) then
()
else
......@@ -328,6 +378,28 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
else
()
case element(tei:g) return
if($node/@ref = "#hb") then
let $super := $node/preceding-sibling::tei:seg[@rendition = "vertical-align:super"][1]
let $sub := $node/following-sibling::tei:seg[@rendition = "vertical-align:sub"][1]
return
element xhtml:span {
simple2xhtml:set-hs-info($node, "fraction"),
element xhtml:span {
simple2xhtml:set-hs-info($node, "fraction-top"),
simple2xhtml:recursion($super/node())
},
element xhtml:span {
simple2xhtml:set-hs-info($node, "fraction-bottom"),
simple2xhtml:recursion($sub/node())
}
}
else if($node/@ref = "#hb") then
()
else
()
default return
simple2xhtml:recursion($node/node())
};
......
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