Commit 67cf878e authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Add sorting and debug element creation

parent 8489b41d
...@@ -20,6 +20,7 @@ declare namespace test="http://exist-db.org/xquery/xqsuite"; ...@@ -20,6 +20,7 @@ declare namespace test="http://exist-db.org/xquery/xqsuite";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../../config/config.xqm"; import module namespace config="http://textgrid.de/ns/SADE/config" at "../../config/config.xqm";
import module namespace console="http://exist-db.org/xquery/console"; import module namespace console="http://exist-db.org/xquery/console";
import module namespace functx="http://www.functx.com"; import module namespace functx="http://www.functx.com";
import module namespace presort="http://fontane-nb.dariah.eu/presort" at "presort.xqm";
import module namespace simpleHelpers="http://fontane-nb.dariah.eu/teisimplehelpers" at "teisimplehelpers.xqm"; import module namespace simpleHelpers="http://fontane-nb.dariah.eu/teisimplehelpers" at "teisimplehelpers.xqm";
...@@ -34,6 +35,7 @@ declare function tidySimple:main($tei as node()*) { ...@@ -34,6 +35,7 @@ declare function tidySimple:main($tei as node()*) {
let $tidy := tidySimple:sort-out-invalid-hands($tei//tei:text) let $tidy := tidySimple:sort-out-invalid-hands($tei//tei:text)
=> tidySimple:sort-out-surplus-elements() => tidySimple:sort-out-surplus-elements()
=> tidySimple:whitespaces() => tidySimple:whitespaces()
=> tidySimple:sort()
(: let $text-with-sections := tidySimple:make-structure($clear-surplus-hands):) (: let $text-with-sections := tidySimple:make-structure($clear-surplus-hands):)
let $header := $tei/tei:teiHeader let $header := $tei/tei:teiHeader
return return
...@@ -180,7 +182,7 @@ declare function tidySimple:copy-element($node as node(), $flag as xs:string) ...@@ -180,7 +182,7 @@ declare function tidySimple:copy-element($node as node(), $flag as xs:string)
: :) : :)
declare function tidySimple:clear-handshift($node as element(tei:milestone)) declare function tidySimple:clear-handshift($node as element(tei:milestone))
as element(tei:milestone) { as element(tei:milestone) {
element tei:milestone { element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
attribute unit {"handshift"}, attribute unit {"handshift"},
if($node/@subtype = "") then if($node/@subtype = "") then
() ()
...@@ -334,4 +336,9 @@ declare function tidySimple:whitespaces($nodes as node()*) as node()* { ...@@ -334,4 +336,9 @@ declare function tidySimple:whitespaces($nodes as node()*) as node()* {
(), (),
tidySimple:whitespaces($node/node()) tidySimple:whitespaces($node/node())
} }
};
declare function tidySimple:sort($nodes as node()*) as node()* {
presort:main($nodes)
}; };
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment