Skip to content
Snippets Groups Projects
Commit d7d575db authored by MRodz's avatar MRodz
Browse files

Extend interface

parent 4b38b4d9
No related branches found
No related tags found
No related merge requests found
......@@ -18,13 +18,33 @@ import module namespace config = "http://bdn-edition.de/intermediate_format/conf
declare option exist:serialize "method=xml media-type=text/xml omit-xml-declaration=no indent=no";
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)
as node()* {
let $replace-whitespace := true()
let $preprocessed-data := pre:preprocessing($doc/tei:TEI, $replace-whitespace)
let $intermediate-format := ident:walk($preprocessed-data, ())
let $store := xmldb:store($config:sade-data, $filename, $intermediate-format)
return xmldb:store($config:sade-data, $filename, $intermediate-format)
return $intermediate-format
};
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)
};
declare function ifweb:single-xml($resource as node()*, $filename as xs:string)
as node()* {
let $filename := substring-before($filename, '.xml') || "-if.xml"
return ifweb:transform($resource, $filename)
};
\ No newline at end of file
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