Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
2cca4917
Commit
2cca4917
authored
Jan 09, 2019
by
mrodzis
💪
Browse files
Summarize tei:hi that belong together (cf. print#64)
parent
b14b7c9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tidysimple.xqm
View file @
2cca4917
...
...
@@ -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):)
...
...
@@ -183,7 +184,9 @@ declare function tidySimple:copy-element($node as node(), $flag as xs:string)
else if($flag = "post") then
tidySimple:sort-out-invalid-hands($node/node())
else if($flag = "surplus") then
tidySimple:sort-out-invalid-hands($node/node())
tidySimple:sort-out-invalid-hands($node/node())
else if($flag = "summarize") then
tidySimple:summarize-entries($node/node())
else
tidySimple:tidy($node/node())
}
...
...
@@ -398,4 +401,31 @@ declare function tidySimple:split-headings($nodes as node()*) as node()* {
else
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
mrodzis
💪
@mrodzis
mentioned in commit
63af34d8
·
Jan 09, 2019
mentioned in commit
63af34d8
mentioned in commit 63af34d817612c9dbf22339d73f324fbd65cfba1
Toggle commit list
mrodzis
💪
@mrodzis
mentioned in commit
9c6772bb
·
Feb 05, 2019
mentioned in commit
9c6772bb
mentioned in commit 9c6772bb90c58cbe9d72996cf3bdb99a8a3776d9
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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