Commit 1d9dfb7d authored by mrodzis's avatar mrodzis 🌎
Browse files

Merge branch 'feature/#100-robustness-tble' into 'develop'

Log errors in URI retrieval via TILE API

Closes #100

See merge request !38
parents 7ab13e01 297a891d
......@@ -29,7 +29,7 @@ import module namespace tidySimple ="http://fontane-nb.dariah.eu/tidysimple" at
declare variable $etTransfo:cases :=
(
"3qtcz.xml", (: case C :)
(: "3qtcz.xml", (: case C :):)
"3qtqv.xml" (: case A :)
(: "3qtqw.xml" (: case B :) :)
(: "3qtqx.xml" (: case D :):)
......@@ -55,7 +55,8 @@ declare function etTransfo:complete() {
etTransfo:create-print-tei()
} catch * {
error(QName("error", "ETTRANSFO02"), "An error occured while creating the whole TEI base for print.")
}
},
etTransfo:tidy-logs()
};
......@@ -157,7 +158,7 @@ declare function etTransfo:transform-tei($tei as element(tei:TEI), $log as xs:st
(: => fsort:main():)
fsort:main($tei, $log)
=> prepCom:main($tei/@id)
=> fontaneSimple:main($tei/@id)
=> fontaneSimple:main($tei/@id, $log)
=> tidySimple:main($tei/@id)
=> simple2xhtml:main($tei/@id)
};
......@@ -326,3 +327,18 @@ declare function etTransfo:assure-dir-available($dir-name as xs:string) {
xmldb:create-collection($etTransfo:dir, "logs")
};
(:~
: Only the logs which acutally contain info should be kept.
:
:)
declare function etTransfo:tidy-logs() {
for $log in collection($etTransfo:dir || "logs/") return
if($log//LogEntry) then
()
else
let $uri := substring-after(base-uri($log), "logs/")
return
xmldb:remove($etTransfo:dir || "logs/", $uri)
};
Markdown is supported
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