Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
intermediate-format
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bibliothek-der-neologie
intermediate-format
Commits
40cc2068
Commit
40cc2068
authored
6 years ago
by
MRodz
Browse files
Options
Downloads
Patches
Plain Diff
Add logging for debugging
parent
d7d575db
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/intermediate_format/ifweb.xql
+11
-0
11 additions, 0 deletions
modules/intermediate_format/ifweb.xql
modules/intermediate_format/preprocessing.xqm
+5
-2
5 additions, 2 deletions
modules/intermediate_format/preprocessing.xqm
with
16 additions
and
2 deletions
modules/intermediate_format/ifweb.xql
+
11
−
0
View file @
40cc2068
...
@@ -12,6 +12,7 @@ module namespace ifweb="http://bdn-edition.de/intermediate_format/ifweb";
...
@@ -12,6 +12,7 @@ module namespace ifweb="http://bdn-edition.de/intermediate_format/ifweb";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
import module namespace console="http://exist-db.org/xquery/console";
import module namespace pre="http://bdn-edition.de/intermediate_format/preprocessing" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/preprocessing.xqm";
import module namespace pre="http://bdn-edition.de/intermediate_format/preprocessing" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/preprocessing.xqm";
import module namespace ident = "http://bdn-edition.de/intermediate_format/identification" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/identification.xqm";
import module namespace ident = "http://bdn-edition.de/intermediate_format/identification" at "xmldb:exist:///db/apps/interformat/modules/intermediate_format/identification.xqm";
import module namespace config = "http://bdn-edition.de/intermediate_format/config" at "xmldb:exist:///db/apps/interformat/modules/config.xqm";
import module namespace config = "http://bdn-edition.de/intermediate_format/config" at "xmldb:exist:///db/apps/interformat/modules/config.xqm";
...
@@ -30,7 +31,9 @@ declare function ifweb:main($resource as xs:string) as xs:string? {
...
@@ -30,7 +31,9 @@ declare function ifweb:main($resource as xs:string) as xs:string? {
declare function ifweb:transform($doc as node()*, $filename as xs:string)
declare function ifweb:transform($doc as node()*, $filename as xs:string)
as node()* {
as node()* {
let $replace-whitespace := true()
let $replace-whitespace := true()
let $log := console:log("Start preprocessing.")
let $preprocessed-data := pre:preprocessing($doc/tei:TEI, $replace-whitespace)
let $preprocessed-data := pre:preprocessing($doc/tei:TEI, $replace-whitespace)
let $log := console:log("Start main processing.")
let $intermediate-format := ident:walk($preprocessed-data, ())
let $intermediate-format := ident:walk($preprocessed-data, ())
let $store := xmldb:store($config:sade-data, $filename, $intermediate-format)
let $store := xmldb:store($config:sade-data, $filename, $intermediate-format)
...
@@ -39,6 +42,14 @@ as node()* {
...
@@ -39,6 +42,14 @@ as node()* {
declare function ifweb:complete-xml($author as xs:string, $xml as node()*)
declare function ifweb:complete-xml($author as xs:string, $xml as node()*)
as node()* {
as node()* {
let $log-dir :=
if(xmldb:collection-available($config:app-root || "/logs")) then
$config:app-root || "/logs"
else
xmldb:create-collection($config:app-root, "logs")
let $log-name := "log.xml"
let $create := xmldb:store($log-dir, $log-name, <root/>)
let $filename := $author || "-full-if.xml"
let $filename := $author || "-full-if.xml"
return ifweb:transform($xml, $filename)
return ifweb:transform($xml, $filename)
};
};
...
...
This diff is collapsed.
Click to expand it.
modules/intermediate_format/preprocessing.xqm
+
5
−
2
View file @
40cc2068
...
@@ -12,6 +12,7 @@ xquery version "3.0";
...
@@ -12,6 +12,7 @@ xquery version "3.0";
:)
:)
module
namespace
pre
=
"http://bdn-edition.de/intermediate_format/preprocessing"
;
module
namespace
pre
=
"http://bdn-edition.de/intermediate_format/preprocessing"
;
import
module
namespace
whitespace
=
"http://bdn-edition.de/intermediate_format/whitespace_handling"
at
"whitespace-handling.xqm"
;
import
module
namespace
whitespace
=
"http://bdn-edition.de/intermediate_format/whitespace_handling"
at
"whitespace-handling.xqm"
;
import
module
namespace
console
=
"http://exist-db.org/xquery/console"
;
declare
default
element
namespace
"http://www.tei-c.org/ns/1.0"
;
declare
default
element
namespace
"http://www.tei-c.org/ns/1.0"
;
...
@@ -109,7 +110,7 @@ declare function pre:default-element
...
@@ -109,7 +110,7 @@ declare function pre:default-element
let
$following-node
:=
$node
/
following-sibling
::
node
()[
1
]
let
$following-node
:=
$node
/
following-sibling
::
node
()[
1
]
let
$following-sibling
:=
$node
/
following-sibling
::*
[
1
]
let
$following-sibling
:=
$node
/
following-sibling
::*
[
1
]
return
return
element
{
$node
/
name
()}{
(
element
{
$node
/
name
()}{
$node
/
@
*,
$node
/
@
*,
(
if
(
$following-node
[
matches
(
.,
"[\s\n\r\t]"
)
and
normalize-space
(
.
)
=
""
]
(
if
(
$following-node
[
matches
(
.,
"[\s\n\r\t]"
)
and
normalize-space
(
.
)
=
""
]
and
$following-sibling
[
self
::
ref
or
self
::
app
or
self
::
hi
or
self
::
bibl
and
$following-sibling
[
self
::
ref
or
self
::
app
or
self
::
hi
or
self
::
bibl
...
@@ -121,7 +122,9 @@ declare function pre:default-element
...
@@ -121,7 +122,9 @@ declare function pre:default-element
attribute
{
"break-after"
}{
"yes"
}
attribute
{
"break-after"
}{
"yes"
}
else
())
,
else
())
,
$recursive-function
$recursive-function
}
}
,
update
insert
$node
into
doc
(
"/db/apps/interformat/logs/log.xml"
)
/*
)
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment