Commit 741bf100 authored by Wolfgang's avatar Wolfgang

docx: add var to config.xqm to define odd and pi to be used by default for imported docs

parent 2a616b72
No preview for this file type
......@@ -269,6 +269,10 @@ declare variable $config:output := "transform";
declare variable $config:output-root := $config:app-root || "/" || $config:output;
declare variable $config:default-odd-for-docx := 'docx-output.odd';
declare variable $config:default-docx-pi := ``[odd="`{$config:default-odd-for-docx}`"]``;
declare variable $config:module-config := doc($config:odd-root || "/configuration.xml")/*;
declare variable $config:repo-descriptor := doc(concat($config:app-root, "/repo.xml"))/repo:meta;
......
......@@ -19,8 +19,15 @@ declare function local:upload($root, $paths, $payloads) {
let $stored := xmldb:store($config:data-root || "/" || $root, xmldb:encode($path), $data)
let $tei :=
docx:process($stored, $config:data-root, docx2tei:transform#2, $mediaPath)
let $teiDoc :=
document {
processing-instruction teipublisher {
$config:default-docx-pi
},
$tei
}
return
xmldb:store($config:data-root || "/" || $root, xmldb:encode($path) || ".xml", $tei)
xmldb:store($config:data-root || "/" || $root, xmldb:encode($path) || ".xml", $teiDoc)
else if (ends-with($path, ".odd")) then
xmldb:store($config:odd-root, xmldb:encode($path), $data)
else
......
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:pb="http://teipublisher.com/1.0" xml:lang="en">
<teiHeader>
<fileDesc>
<titleStmt>
<title>DOCX Output Preview <desc>A test ODD to preview TEI imported from Word docx</desc>
</title>
</titleStmt>
<publicationStmt>
<publisher>eXistSolutions GmbH</publisher>
<availability>
<licence target="https://www.gnu.org/licenses/gpl-3.0.en.html">Distributed under GNU General Public License</licence>
<p>Copyright 2017 <ref target="http://existsolutions.com">eXistSolutions GmbH</ref>
</p>
<p>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</p>
</availability>
</publicationStmt>
<sourceDesc>
<p>Generated by <ref target="http://tei-publisher.com">TEI Publisher</ref>
</p>
<p>born digital</p>
</sourceDesc>
</fileDesc>
<revisionDesc>
<change when="2019-09-25+02:00">Initial version</change>
</revisionDesc>
</teiHeader>
<text>
<body>
<schemaSpec start="TEI teiCorpus" ident="docx-output" source="teipublisher.odd"> <elementSpec ident="gi" mode="add">
<model behaviour="inline">
<outputRendition xml:space="preserve">
font-family: Menlo, Consolas, monospace;
font-size: 0.85em;
</outputRendition>
</model>
</elementSpec>
<elementSpec ident="placeName" mode="add">
<model predicate="@rend='smallcaps'" behaviour="link">
<param name="uri" value="'https://www.google.de/maps/place/' || @ref"/>
<param name="target" value="'_blank'"/>
<outputRendition xml:space="preserve">
color: #e24329;
font-variant: smallcaps;
</outputRendition>
</model>
<model behaviour="inline">
<outputRendition xml:space="preserve">
color: #e24329;
</outputRendition>
</model>
</elementSpec>
<elementSpec ident="persName" mode="add">
<model predicate="@ref" behaviour="link">
<param name="uri" value="@ref"/>
<param name="target" value="'_blank'"/>
<outputRendition xml:space="preserve">
color: #007e00;
</outputRendition>
</model>
<model behaviour="inline">
<outputRendition xml:space="preserve">
color: #007e00;
</outputRendition>
</model>
</elementSpec>
<elementSpec ident="tag" mode="add">
<model behaviour="inline">
<outputRendition xml:space="preserve">
font-family: Menlo, Consolas, monospace;
font-size: .85em;
</outputRendition>
</model>
</elementSpec>
<elementSpec ident="quote" mode="change">
<model predicate="ancestor::p" behaviour="inline" useSourceRendition="true">
<desc>If it is inside a paragraph then it is inline, otherwise it is block level</desc>
<outputRendition xml:space="preserve" scope="before">
content: '‘';
</outputRendition>
<outputRendition xml:space="preserve" scope="after">
content: '’';
</outputRendition>
</model>
<model behaviour="block" useSourceRendition="true">
<desc>If it is inside a paragraph then it is inline, otherwise it is block level</desc>
<outputRendition xml:space="preserve">
margin-left: 10px;
margin-right: 10px;
padding-left: 10px;
border-left: 1px solid #C0C0C0;
</outputRendition>
</model>
</elementSpec>
</schemaSpec>
</body>
</text>
</TEI>
\ No newline at end of file
......@@ -264,6 +264,10 @@ declare variable $config:output := "transform";
declare variable $config:output-root := $config:app-root || "/" || $config:output;
declare variable $config:default-odd-for-docx := $config:default-odd;
declare variable $config:default-docx-pi := ``[odd="`{$config:default-odd-for-docx}`"]``;
declare variable $config:module-config := doc($config:odd-root || "/configuration.xml")/*;
declare variable $config:repo-descriptor := doc(concat($config:app-root, "/repo.xml"))/repo:meta;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment