Commit c3f3eb17 authored by mrodzis's avatar mrodzis 🐸
Browse files

Fix bug in sorting out elements (cf. print#21)

parent f0f2a121
......@@ -80,10 +80,25 @@ as node()* {
default return
let $prev-handshift := $node/preceding::tei:milestone[@unit = "handshift"][1]
let $first-child-handshift := $node/child::tei:milestone[@unit = "handshift"][1]
let $first-child-element := $node/child::*[1]
let $first-child-node := $node/child::node()[1]
return
if($prev-handshift
(: in some cases the valid handshift is the first child node
instead of a previous node. of course we want to keep the element
then :)
if($first-child-element = $first-child-handshift
(: ensure there's no text before the handshift :)
and (normalize-space($first-child-node) = ""
or $first-child-element = $first-child-node)
and simpleHelpers:is-hand-valid($tidySimple:valid-hands, $first-child-handshift)) then
tidySimple:copy-element($node, "post")
else if($prev-handshift
and not(simpleHelpers:is-hand-valid($tidySimple:valid-hands, $prev-handshift))) then
()
else
tidySimple:copy-element($node, "post")
};
......
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