Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
6bddd39f
Commit
6bddd39f
authored
Jan 09, 2019
by
mrodzis
🌿
Browse files
Summarize tei:hi that belong together (cf. print#64)
parent
5fd3e0f6
Changes
1
Show whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tidysimple.xqm
View file @
6bddd39f
...
...
@@ -35,6 +35,7 @@ declare function tidySimple:main($tei as node()*) {
let $tidy := tidySimple:sort-out-invalid-hands($tei//tei:text)
=> tidySimple:sort-out-surplus-elements()
=> tidySimple:whitespaces()
=> tidySimple:summarize-entries()
=> tidySimple:split-headings()
(: => tidySimple:sort():)
(: let $text-with-sections := tidySimple:make-structure($clear-surplus-hands):)
...
...
@@ -184,6 +185,8 @@ declare function tidySimple:copy-element($node as node(), $flag as xs:string)
tidySimple:sort-out-invalid-hands($node/node())
else if($flag = "surplus") then
tidySimple:sort-out-invalid-hands($node/node())
else if($flag = "summarize") then
tidySimple:summarize-entries($node/node())
else
tidySimple:tidy($node/node())
}
...
...
@@ -399,3 +402,30 @@ declare function tidySimple:split-headings($nodes as node()*) as node()* {
tidySimple:split-headings($node/node())
}
};
declare function tidySimple:summarize-entries($nodes as node()*) as node()* {
for $node in $nodes return
typeswitch ($node)
case text() return
$node
case element(tei:hi) return
if($node[@next]) then
let $this-content := $node/child::text()
let $next-content := $node/following-sibling::tei:hi[1]/child::text()
let $break := if($node/@break = "true") then text{" "} else ()
let $content := ($this-content, $break, $next-content)
return
element {QName("http://www.tei-c.org/ns/1.0", "hi")} {
$content
}
else if($node[@prev]) then
()
else
tidySimple:copy-element($node, "summarize")
default return
tidySimple:copy-element($node, "summarize")
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment