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
60cb4b01
Commit
60cb4b01
authored
Jul 25, 2018
by
MRodz
Committed by
mrodzis
Feb 05, 2019
Browse files
Clear handshifts while preprocessing them
parent
025cddb8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tests/tidysimple-test.xql
View file @
60cb4b01
...
...
@@ -44,10 +44,10 @@ declare
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" script=""Latf""/>Some text<handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" script=""Latn""/></div>")
%test:args("<div xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium="""" script=""Latn""/>Some text<handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium="""" script=""Latn""/></div>")
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0""
medium=""""
new=""#Fontane"" script=""Latn""/>Some text</div>")
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" script=""Latn""/>Some text</div>")
%test:args("<body xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" script=""Latf standard"" medium=""""/><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" script="""" medium=""""/><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""section"" type=""Text_1"" spanTo=""#C07_3r_s""/><handShift xmlns=""http://www.tei-c.org/ns/1.0"" script=""Latn clean"" new=""#Fontane"" medium=""""/><head xmlns=""http://www.tei-c.org/ns/1.0"" type=""x-large"" rend=""align(center)""><rs xmlns=""http://www.tei-c.org/ns/1.0"" type=""direct"" ref=""psn:Luther""><hi xmlns=""http://www.tei-c.org/ns/1.0"">Luther</hi></rs></head></body>")
%test:assertEquals("<body xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""section"" type=""Text_1"" spanTo=""#C07_3r_s""/><handShift xmlns=""http://www.tei-c.org/ns/1.0"" script=""Latn clean"" new=""#Fontane""
medium=""""
/><head xmlns=""http://www.tei-c.org/ns/1.0"" type=""x-large"" rend=""align(center)""><rs xmlns=""http://www.tei-c.org/ns/1.0"" type=""direct"" ref=""psn:Luther""><hi xmlns=""http://www.tei-c.org/ns/1.0"">Luther</hi></rs></head></body>")
%test:assertEquals("<body xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""section"" type=""Text_1"" spanTo=""#C07_3r_s""/><handShift xmlns=""http://www.tei-c.org/ns/1.0"" script=""Latn clean"" new=""#Fontane""/><head xmlns=""http://www.tei-c.org/ns/1.0"" type=""x-large"" rend=""align(center)""><rs xmlns=""http://www.tei-c.org/ns/1.0"" type=""direct"" ref=""psn:Luther""><hi xmlns=""http://www.tei-c.org/ns/1.0"">Luther</hi></rs></head></body>")
function tidysimple-test:handShift-surplus($node as element(*)) {
tidySimple:sort-out-surplus-hands($node)
...
...
modules/fontane/teisimpleprint/tidysimple.xqm
View file @
60cb4b01
...
...
@@ -41,7 +41,7 @@ declare function tidySimple:main($tei as node()*) as xs:string* {
let $clear-invalid-hands := tidySimple:sort-out-invalid-hands($text)
let $clear-surplus-hands := tidySimple:sort-out-surplus-hands($clear-invalid-hands)
let $text-with-sections := tidySimple:make-structure($clear-surplus-hands)
let $store := xmldb:store("/db/apps/SADE/resources/xml/", "tei-simple-tmp.xml", <div>{$
clear-surplus-hand
s}</div>)
let $store := xmldb:store("/db/apps/SADE/resources/xml/", "tei-simple-tmp.xml", <div>{$
text-with-section
s}</div>)
return ""
(: let $doc := doc($config:app-root || "/resources/xml/tei-simple-tmp.xml"):)
(: let $tidied-text := tidySimple:tidy($doc//tei:text):)
...
...
@@ -67,7 +67,7 @@ as node()* {
case element(tei:handShift) return
if(simpleHelpers:is-hand-valid($tidySimple:valid-hands, $node)) then
tidySimple:c
opy-element($node, "post"
)
tidySimple:c
lear-handshift($node
)
else
()
...
...
@@ -106,7 +106,7 @@ as node()* {
or not(tidySimple:has-hand-text($node))) then
()
else
tidySimple:c
opy-element($node, "surplus"
)
tidySimple:c
lear-handshift($node
)
default return
element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
...
...
resources/xml/tei-simple-tmp.xml
View file @
60cb4b01
This diff is collapsed.
Click to expand it.
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