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
2b384067
Commit
2b384067
authored
Nov 19, 2018
by
mrodzis
💪
Browse files
Add handling for headings with new line (cf. print#22)
parent
f6d28e9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tei2teisimple.xqm
View file @
2b384067
...
...
@@ -725,7 +725,6 @@ declare function fontaneSimple:make-head($node as node()) as element(tei:head) {
else
attribute style {"default"}
),
attribute type {"former-" || $node/name()},
$node/@subtype,
(if($node/@rendition) then
$node/@rendition
...
...
modules/fontane/teisimpleprint/tidysimple.xqm
View file @
2b384067
...
...
@@ -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:split-headings()
(: => tidySimple:sort():)
(: let $text-with-sections := tidySimple:make-structure($clear-surplus-hands):)
let $header := $tei/tei:teiHeader
...
...
@@ -338,6 +339,42 @@ declare function tidySimple:whitespaces($nodes as node()*) as node()* {
};
declare function tidySimple:sort($nodes as node()*) as node()* {
presort:main($nodes)
declare function tidySimple:split-headings($nodes as node()*) as node()* {
for $node in $nodes return
typeswitch($node)
case text() return
$node
case element(tei:head) return
if($node//tei:lb[@type = "edited_text"]) then
let $lb := $node//tei:lb[@type = "edited_text"]
let $split-top := $node/node()[. << $lb]
let $split-bottom := $node/node()[. >> $lb]
let $test := util:log-system-out($split-top)
return
element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
$node/@*,
(element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"upper-part"},
$split-top
},
element {QName("http://www.tei-c.org/ns/1.0", "lb")} {
attribute type {"edited_text"}
},
element {QName("http://www.tei-c.org/ns/1.0", "seg")} {
attribute type {"lower-part"},
$split-bottom
})
}
else
element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
$node/@*,
tidySimple:split-headings($node/node())
}
default return
element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
$node/@*,
tidySimple:split-headings($node/node())
}
};
\ 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