Commit 59dd5a7d authored by mrodzis's avatar mrodzis 🌿
Browse files

Remember lines when sorting

parent f48e58bf
......@@ -170,6 +170,13 @@ declare function fsort:apply-all-nexts($node as node(), $log as xs:string) as no
return
if(count($next-node) = 1) then
(fsort:keep-node($node, "sort", $log),
(: check if the parts are in different lines :)
if($node/ancestor::tei:line = $next-node/ancestor::tei:line) then
()
else
element tei:milestone {
attribute unit {"line"}
},
fsort:apply-all-nexts($next-node, $log))
else if(not($next-node)) then
fsort:add-log-entry($log, "No next node found for " || $node/@next)
......@@ -189,6 +196,13 @@ declare function fsort:apply-all-nexts($node as node(), $log as xs:string) as no
if(count($next-node) = 1) then
($prev-handshift,
fsort:keep-node($node, "sort", $log),
(: check if the parts are in different lines :)
if($node/ancestor::tei:line = $next-node/ancestor::tei:line) then
()
else
element tei:milestone {
attribute unit {"line"}
},
fsort:apply-all-nexts($next-node, $log))
else if(not($next-node)) then
fsort:add-log-entry($log, "No next node found for " || $node/@next)
......
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