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
da5bcd3d
Commit
da5bcd3d
authored
6 years ago
by
Michelle Weidling
Browse files
Options
Downloads
Plain Diff
Merge branch 'release/1.0.0'
parents
e578ced2
c9b6571a
No related branches found
No related tags found
No related merge requests found
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.properties
+1
-1
1 addition, 1 deletion
build.properties
modules/intermediate_format/ifweb.xql
+28
-13
28 additions, 13 deletions
modules/intermediate_format/ifweb.xql
modules/intermediate_format/preprocessing.xqm
+18
-8
18 additions, 8 deletions
modules/intermediate_format/preprocessing.xqm
with
47 additions
and
22 deletions
build.properties
+
1
−
1
View file @
da5bcd3d
project.name
=
http://bdn-edition.de/intermediate_format
project.name
=
http://bdn-edition.de/intermediate_format
-develop
project.version
=
1.0.0
project.title
=
BdN Intermediate Format
project.abbrev
=
interformat-develop
...
...
This diff is collapsed.
Click to expand it.
modules/intermediate_format/ifweb.xql
+
28
−
13
View file @
da5bcd3d
(:~
(:~
: ifweb.xql offers a simple interface for creating the website specific BdN
: intermediate format of a given resource.
:
:
: @author Michelle Rodzis
: @version 1.0
:
:
:)
xquery version "3.1";
...
...
@@ -24,17 +24,17 @@ declare variable $ifweb:replace-whitespace := true();
declare function ifweb:main($resource as xs:string) as xs:string? {
let $doc := doc($config:sade-data || $resource)
let $filename := substring-before($resource, '.xml') || "-if.xml"
return ifweb:transform($doc, $filename)
};
declare function ifweb:transform($doc as node()*, $filename as xs:string)
declare function ifweb:transform($doc as node()*, $filename as xs:string)
as node()* {
let $preprocessed-data := pre:preprocessing($doc/tei:TEI, $ifweb:replace-whitespace)
let $intermediate-format := ident:walk($preprocessed-data, ())
let $store := xmldb:store($config:sade-data, $filename, $intermediate-format)
return $intermediate-format
};
...
...
@@ -44,12 +44,12 @@ $target-dir as xs:string) as node()* {
let $preprocessed-data := pre:preprocessing($doc/tei:TEI, $ifweb:replace-whitespace)
let $intermediate-format := ident:walk($preprocessed-data, ())
let $store := xmldb:store($target-dir, $filename, $intermediate-format)
return $intermediate-format
};
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()* {
let $filename := $author || "-full-if.xml"
return ifweb:transform($xml, $filename)
...
...
@@ -61,17 +61,32 @@ $target-dir as xs:string) as node()* {
return ifweb:transform($resource, $filename, $target-dir)
};
declare function ifweb:transform-split-xml($xml as node()*, $filename as xs:string,
declare function ifweb:transform-split-xml($xml as node()*, $filename as xs:string,
$dir as xs:string) {
let $preprocessed-data := pre:preprocessing($xml/*, $ifweb:replace-whitespace)
let $intermediate-format := ident:walk($preprocessed-data, ())
let $content :=
element tei:div {
(: sometimes we have structural variance on chapter level - in these cases
tei:app is the root element of $xml, not tei:div. for the HTML serialization
of the structural variance to function properly we have to preserve the
tei:app :)
let $content :=
if($xml[self::tei:app]) then
element tei:app {
$xml/@*,
attribute id {generate-id($xml)},
$intermediate-format
}
let $store := xmldb:store($dir, $filename, $content)
else
($xml/@*,
attribute id {generate-id($xml)},
$intermediate-format)
let $transformed :=
element tei:div {
$content
}
let $store := xmldb:store($dir, $filename, $transformed)
return $intermediate-format
};
This diff is collapsed.
Click to expand it.
modules/intermediate_format/preprocessing.xqm
+
18
−
8
View file @
da5bcd3d
...
...
@@ -51,7 +51,9 @@ declare function pre:preprocessing-textNode
element
{
$node
/
name
()}{
$node
/
@
*,
pre:preprocessing-textNode
(
$node
/
node
())
,
element
{
"editorial-notes"
}{}
element
{
"editorial-notes"
}{
$node
//
note
[
@type
eq
"editorial-commentary"
]
}
}
)
...
...
@@ -141,7 +143,7 @@ declare function pre:default-element
: @author Uwe Sikora
:)
declare
function
pre:preprocessing
(
$nodes
as
node
()
*,
$replace-whitespace
as
xs:boolean
)
(
$nodes
as
node
()
*,
$replace-whitespace
as
xs:boolean
)
as
item
()
*
{
for
$node
in
$nodes
...
...
@@ -164,7 +166,11 @@ declare function pre:preprocessing
element
{
$node
/
name
()}{
$node
/
@
*,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
,
element
{
"editorial-notes"
}{}
element
{
"editorial-notes"
}{
for
$editorial-note
in
$node
//
note
[
@type
eq
"editorial-commentary"
]
return
pre:default-element
(
$editorial-note
,
pre:preprocessing
(
$editorial-note
/
node
()
,
$replace-whitespace
)
)
}
}
)
...
...
@@ -179,26 +185,26 @@ declare function pre:preprocessing
$node
/
@
*,
attribute
id
{
generate-id
(
$node
)}
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
}
}
else
if
(
$node
[
not
(
@type
)][
not
(
descendant
::
div
)])
then
element
{
$node
/
name
()}{
attribute
type
{
"single-div"
}
,
attribute
id
{
generate-id
(
$node
)}
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
}
}
else
(
pre:default-element
(
$node
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
)
)
)
case
element
(
app
)
return
if
(
$node
/
parent
::
div
[
@type
=
"section-group"
])
then
element
{
$node
/
name
()}{
attribute
type
{
"standalone"
}
,
attribute
id
{
generate-id
(
$node
)}
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
}
}
else
pre:default-element
(
$node
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
)
...
...
@@ -219,7 +225,11 @@ declare function pre:preprocessing
)
case
element
(
note
)
return
(
pre:default-element
(
$node
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
)
if
(
$node
[
@type
!=
"editorial-commentary"
]
or
$node
[
not
(
@type
)
]
)
then
(
pre:default-element
(
$node
,
pre:preprocessing
(
$node
/
node
()
,
$replace-whitespace
)
)
)
else
(
)
(: pre:default-element( $node, pre:preprocessing($node/node(), $replace-whitespace) ):)
)
case
element
(
pb
)
return
(
...
...
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