Skip to content

Commit

Permalink
docx import now requires ext-docx module
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Oct 11, 2023
1 parent e3a4a9c commit 65692fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions odd/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
<property name="section-numbers">false()</property>
<property name="font-size">"11pt"</property>
</output>
<output mode="tei" odd="docx">
<module uri="http://www.tei-c.org/tei-simple/xquery/functions/docx" prefix="ext-docx"/>
</output>
</modules>
4 changes: 4 additions & 0 deletions templates/basic/resources/odd/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
<!--output mode="web" odd="documentation">
<module uri="http://www.tei-c.org/tei-simple/xquery/ext-html" prefix="ext-html" at="xmldb:exist:///db/apps/tei-publisher/modules/ext-html.xql"/>
</output-->
<!-- Required for MS Word docx to TEI transformations -->
<output mode="tei" odd="docx">
<module uri="http://www.tei-c.org/tei-simple/xquery/functions/docx" prefix="ext-docx"/>
</output>
</modules>
6 changes: 5 additions & 1 deletion transform/docx-tei.xql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import module namespace css="http://www.tei-c.org/tei-simple/xquery/css";

import module namespace tei="http://existsolutions.com/xquery/functions/tei";

import module namespace ext-docx="http://www.tei-c.org/tei-simple/xquery/functions/docx";

import module namespace global="http://www.tei-c.org/tei-simple/config" at "../modules/config.xqm";

(: generated template function for element spec: r :)
declare %private function model:template-r6($config as map(*), $node as node()*, $params as map(*)) {
<persName xmlns="http://www.tei-c.org/ns/1.0" ref="http://d-nb.info/gnd/{$config?apply-children($config, $node, $params?ref)}">{$config?apply-children($config, $node, $params?content)}</persName>
Expand Down Expand Up @@ -79,7 +83,7 @@ declare function model:transform($options as map(*), $input as node()*) {

let $output := model:apply($config, $input)
return
tei:finish($config, $output)
ext-docx:finish($config, $output)
)
};

Expand Down

0 comments on commit 65692fe

Please sign in to comment.