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
6695a099
Commit
6695a099
authored
Jul 31, 2019
by
mrodzis
💪
Committed by
Mathias Goebel
Jul 31, 2019
Browse files
Add single transformation for ET, extend logging
parent
ccd187eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/edited-text/etTransfo.xqm
View file @
6695a099
...
...
@@ -13,6 +13,7 @@ xquery version "3.1";
module namespace etTransfo="http://fontane-nb.dariah.eu/etTransfo";
declare namespace err="http://www.w3.org/2005/xqt-errors";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace xi="http://www.w3.org/2001/XInclude";
...
...
@@ -60,6 +61,32 @@ declare function etTransfo:complete() {
etTransfo:report-errors()
};
(:~
: A function to trigger the creation of the edited text for a single notebook.
: Mainly used for parallel creation of the notebooks.
:
: @param $uri The notebook's URI, e.g. "16b00" :)
declare function etTransfo:transform-single-nb($uri as xs:string) as xs:string* {
let $log := util:log-system-out("Start creating edited text for " || $uri)
let $log := etTransfo:create-log($uri)
let $tei := doc($config:data-root || "/data/" || $uri || ".xml")//tei:TEI
let $updated-notebook :=
element tei:TEI {
attribute id {$uri},
$tei/@*,
$tei/*
}
return
(try {
etTransfo:transform-tei($updated-notebook, $log)
} catch * {
etTransfo:add-log-entry($log, "ETTRANSFO08: Couldn't transform TEI. ")
},
etTransfo:tidy-logs(),
etTransfo:report-errors())
};
(:~
: Resolves all XIncludes in a given case file and copies all notebooks belonging to a case into one file.
...
...
@@ -175,28 +202,32 @@ declare function etTransfo:transform-tei($tei as element(tei:TEI), $log as xs:st
try {
prepCom:main($sorted, $tei/@id)
} catch * {
etTransfo:add-log-entry($log, "ETTRANSFO10: Error while preparing commentary for this notebook. ")
etTransfo:add-log-entry($log, "ETTRANSFO10: Error while preparing commentary for this notebook. Reason: " ||
concat("[", $err:line-number, ": ", $err:column-number, "] Error ", $err:code, ": ", $err:description))
}
let $transform-to-interform :=
try {
fontaneSimple:main($prepare-comment, $tei/@id, $log)
} catch * {
etTransfo:add-log-entry($log, "ETTRANSFO11: Error while transforming this notebook to an intermediate format. ")
etTransfo:add-log-entry($log, "ETTRANSFO11: Error while transforming this notebook to an intermediate format. Reason: " ||
concat("[", $err:line-number, ": ", $err:column-number, "] Error ", $err:code, ": ", $err:description))
}
let $tidy-interform :=
try {
tidySimple:main($transform-to-interform, $tei/@id)
} catch * {
etTransfo:add-log-entry($log, "ETTRANSFO12: Error while tidying up the intermediate format for this notebook. ")
etTransfo:add-log-entry($log, "ETTRANSFO12: Error while tidying up the intermediate format for this notebook. Reason: " ||
concat("[", $err:line-number, ": ", $err:column-number, "] Error ", $err:code, ": ", $err:description))
}
return
try {
simple2xhtml:main($tidy-interform, $tei/@id)
} catch * {
etTransfo:add-log-entry($log, "ETTRANSFO13: Error while creating XHTML for this notebook. ")
etTransfo:add-log-entry($log, "ETTRANSFO13: Error while creating XHTML for this notebook. Reason: " ||
concat("[", $err:line-number, ": ", $err:column-number, "] Error ", $err:code, ": ", $err:description))
}
};
...
...
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