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
9c6772bb
Commit
9c6772bb
authored
Jan 09, 2019
by
mrodzis
💪
Browse files
Improve summarizigng process (cf.
2cca4917
)
parent
6bddd39f
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/teisimplehelpers.xqm
View file @
9c6772bb
...
...
@@ -76,7 +76,7 @@ as xs:boolean {
: :)
declare function simpleHelpers:prepare-text($node as text()) as text()? {
if(not(normalize-space($node) = "")) then
(: the @ serves as a flag for the removal of hyphens. this is necessary
(: the @
P
serves as a flag for the removal of hyphens. this is necessary
since we sometimes have cases where a hyphen is the only content of a
string. functx:substring-before-last would therefore produce an empty
string which leads to problems while preparing the text any further. :)
...
...
modules/fontane/teisimpleprint/tidysimple.xqm
View file @
9c6772bb
...
...
@@ -411,15 +411,13 @@ declare function tidySimple:summarize-entries($nodes as node()*) as node()* {
$node
case element(tei:hi) return
if($node
[
@next
]
) then
if($node
/
@next
and not($node/@prev)
) 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
$this-content,
tidySimple:get-next-content($node, ())
}
else if($node[@prev]) then
()
...
...
@@ -428,4 +426,19 @@ declare function tidySimple:summarize-entries($nodes as node()*) as node()* {
default return
tidySimple:copy-element($node, "summarize")
};
declare function tidySimple:get-next-content($node as node()*, $content as node()*)
as node()* {
if($node/@next) then
let $next-hi-id := substring-after($node/@next, "#")
let $next-node := $node/following-sibling::*[@xml:id = $next-hi-id]
let $next-content := $next-node/text()
let $break := if($node/@break = "true") then text{" "} else ()
let $content := ($content, $break, $next-content)
return
tidySimple:get-next-content($next-node, $content)
else
$content
};
\ No newline at end of file
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