Skip to content
Snippets Groups Projects
Commit 607d1a54 authored by Michelle Weidling's avatar Michelle Weidling :blowfish:
Browse files

Closes bdn-SADE#45

parent d0c5abe4
No related branches found
No related tags found
1 merge request!3Closes bdn-SADE#45
......@@ -64,6 +64,7 @@ $target-dir as xs:string) as node()* {
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 $editorial-notes := pre:get-editorial-notes($xml/*, $ifweb:replace-whitespace)
let $intermediate-format := ident:walk($preprocessed-data, ())
(: sometimes we have structural variance on chapter level - in these cases
......@@ -84,7 +85,8 @@ $dir as xs:string) {
let $transformed :=
element tei:div {
$content
$content,
$editorial-notes
}
let $store := xmldb:store($dir, $filename, $transformed)
......
......@@ -51,9 +51,7 @@ declare function pre:preprocessing-textNode
element{$node/name()}{
$node/@*,
pre:preprocessing-textNode($node/node()),
element{"editorial-notes"}{
$node//note[@type eq "editorial-commentary"]
}
pre:get-editorial-notes($node, $replace-whitespace)
}
)
......@@ -166,11 +164,7 @@ declare function pre:preprocessing
element{$node/name()}{
$node/@*,
pre:preprocessing($node/node(), $replace-whitespace),
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) )
}
pre:get-editorial-notes($node, $replace-whitespace)
}
)
......@@ -312,3 +306,16 @@ declare function pre:preprocessing
pre:default-element( $node, pre:preprocessing($node/node(), $replace-whitespace) )
)
};
(:~
: Returns all editorial notes of a document in a new element.
:
: @author Michelle Weidling :)
declare function pre:get-editorial-notes($node as node()*, $replace-whitespace)
as 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))
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment