Commit 4ea47209 authored by Wolfgang's avatar Wolfgang

Fix and improve docx conversion sample

parent a66c3d75
No preview for this file type
.content {
font-family: 'Roboto', 'Noto', sans-serif;
}
h1, h2, h3, h4, h5, h6 {
line-height: 1.2;
}
h1 {
font-family: "Oswald",Verdana,"Helvetica", sans-serif;
font-size: 42px;
font-weight: 400;
line-height: 1.2;
color: #5572C0;
}
h2 {
font-family: "Oswald",Verdana,"Helvetica",sans-serif;
font-size: 26px;
font-weight: 400;
background-color: #5572C0;
color: white;
padding: .5em .25em;
}
h3 {
font-family: "Oswald",Verdana,"Helvetica",sans-serif;
font-weight: 400;
background-color: #DAE1F2;
padding: .5em .25em;
}
h4 {
font-family: "Oswald",Verdana,"Helvetica",sans-serif;
font-weight: 400;
color: #2C3962;
text-transform: uppercase;
border-top: 1px solid #2C3962;
padding-top: .25em;
}
\ No newline at end of file
......@@ -2,7 +2,8 @@
<teiHeader>
<fileDesc>
<titleStmt>
<title>DOCX Output Preview <desc>A test ODD to preview TEI imported from Word docx</desc>
<title>DOCX Output Preview
<desc>A test ODD to preview TEI imported from Word docx</desc>
</title>
</titleStmt>
<publicationStmt>
......@@ -37,9 +38,11 @@
<model behaviour="inline">
<outputRendition xml:space="preserve">
font-family: Menlo, Consolas, monospace;
font-size: 0.85em;
</outputRendition>
</model>
</elementSpec>
......@@ -49,7 +52,7 @@ font-size: 0.85em;
<param name="target" value="'_blank'"/>
<outputRendition xml:space="preserve">
color: #e24329;
font-variant: smallcaps;
font-variant: small-caps;
</outputRendition>
</model>
<model behaviour="inline">
......@@ -76,9 +79,11 @@ font-variant: smallcaps;
<model behaviour="inline">
<outputRendition xml:space="preserve">
font-family: Menlo, Consolas, monospace;
font-size: .85em;
</outputRendition>
</model>
</elementSpec>
......@@ -96,11 +101,13 @@ font-size: .85em;
<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>
......
......@@ -21,7 +21,8 @@
<desc>Convert DOCX via ODD</desc>
<desc>Convert DOCX via ODD</desc>
</title>
<title type="short">DOCX Import</title>
</titleStmt>
......@@ -93,7 +94,7 @@
<param name="tei_element" value="'tag'"/>
</model>
<model predicate="$parameters?cstyle(.)/name[starts-with(@w:val, 'tei:')] and matches(., '&amp;#60;.*=.*&amp;#62;')" behaviour="inline">
<desc>Character style starts with 'tei:' and has '&lt;...&gt;' in content, which will be interpreted as attribute list</desc>
<desc>Character style starts with 'tei:' and has parameters in content, which will be interpreted as attribute list</desc>
<param name="tei_element" value="substring-after($parameters?cstyle(.)/name/@w:val, 'tei:')"/>
<param name="tei_attributes" value="tokenize(replace(., '^.*?&amp;#60;(.*)&amp;#62;.*$', '$1'), '\s*;\s*')"/>
<param name="content" value="replace(., '^(.*?)&amp;#60;.*&amp;#62;(.*)$', '$1$2')"/>
......
import module namespace m='http://www.tei-c.org/pm/models/docx-output/epub' at '/db/apps/tei-publisher/transform/docx-output-epub.xql';
declare variable $xml external;
declare variable $parameters external;
let $options := map {
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
\ No newline at end of file
module namespace pml='http://www.tei-c.org/pm/models/docx-output/epub/module';
import module namespace m='http://www.tei-c.org/pm/models/docx-output/epub' at '/db/apps/tei-publisher/transform/docx-output-epub.xql';
(: Generated library module to be directly imported into code which
: needs to transform TEI nodes using the ODD this module is based on.
:)
declare function pml:transform($xml as node()*, $parameters as map(*)?) {
let $options := map {
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
};
\ No newline at end of file
This diff is collapsed.
import module namespace m='http://www.tei-c.org/pm/models/docx-output/latex' at '/db/apps/tei-publisher/transform/docx-output-latex.xql';
declare variable $xml external;
declare variable $parameters external;
let $options := map {
"class": "article",
"section-numbers": false(),
"font-size": "11pt",
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
\ No newline at end of file
module namespace pml='http://www.tei-c.org/pm/models/docx-output/latex/module';
import module namespace m='http://www.tei-c.org/pm/models/docx-output/latex' at '/db/apps/tei-publisher/transform/docx-output-latex.xql';
(: Generated library module to be directly imported into code which
: needs to transform TEI nodes using the ODD this module is based on.
:)
declare function pml:transform($xml as node()*, $parameters as map(*)?) {
let $options := map {
"class": "article",
"section-numbers": false(),
"font-size": "11pt",
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
};
\ No newline at end of file
This diff is collapsed.
import module namespace m='http://www.tei-c.org/pm/models/docx-output/fo' at '/db/apps/tei-publisher/transform/docx-output-print.xql';
declare variable $xml external;
declare variable $parameters external;
let $options := map {
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
\ No newline at end of file
module namespace pml='http://www.tei-c.org/pm/models/docx-output/fo/module';
import module namespace m='http://www.tei-c.org/pm/models/docx-output/fo' at '/db/apps/tei-publisher/transform/docx-output-print.xql';
(: Generated library module to be directly imported into code which
: needs to transform TEI nodes using the ODD this module is based on.
:)
declare function pml:transform($xml as node()*, $parameters as map(*)?) {
let $options := map {
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
};
\ No newline at end of file
This diff is collapsed.
import module namespace m='http://www.tei-c.org/pm/models/docx-output/web' at '/db/apps/tei-publisher/transform/docx-output-web.xql';
declare variable $xml external;
declare variable $parameters external;
let $options := map {
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
\ No newline at end of file
module namespace pml='http://www.tei-c.org/pm/models/docx-output/web/module';
import module namespace m='http://www.tei-c.org/pm/models/docx-output/web' at '/db/apps/tei-publisher/transform/docx-output-web.xql';
(: Generated library module to be directly imported into code which
: needs to transform TEI nodes using the ODD this module is based on.
:)
declare function pml:transform($xml as node()*, $parameters as map(*)?) {
let $options := map {
"styles": ["../transform/docx-output.css"],
"collection": "/db/apps/tei-publisher/transform",
"parameters": if (exists($parameters)) then $parameters else map {}
}
return m:transform($options, $xml)
};
\ No newline at end of file
This diff is collapsed.
/* Generated stylesheet. Do not edit. */
/* Global styles */
/* external styles loaded from docx-output.css */
.content {
font-family: 'Roboto', 'Noto', sans-serif;
}
h1, h2, h3, h4, h5, h6 {
line-height: 1.2;
}
h1 {
font-family: "Oswald",Verdana,"Helvetica", sans-serif;
font-size: 42px;
font-weight: 400;
line-height: 1.2;
color: #5572C0;
}
h2 {
font-family: "Oswald",Verdana,"Helvetica",sans-serif;
font-size: 26px;
font-weight: 400;
background-color: #5572C0;
color: white;
padding: .5em .25em;
}
h3 {
font-family: "Oswald",Verdana,"Helvetica",sans-serif;
font-weight: 400;
background-color: #DAE1F2;
padding: .5em .25em;
}
h4 {
font-family: "Oswald",Verdana,"Helvetica",sans-serif;
font-weight: 400;
color: #2C3962;
text-transform: uppercase;
border-top: 1px solid #2C3962;
padding-top: .25em;
}
.simple_allcaps { text-transform: uppercase; }
.simple_blackletter { font-family: fantasy; }
.simple_bold { font-weight: bold; }
.simple_bottombraced { padding-bottom: 2pt; border-bottom: dashed gray 2pt; }
.simple_block { display:block; }
.simple_boxed { padding: 2pt; border: solid black 1pt; }
.simple_centre { text-align: center; }
.simple_cursive { font-family: cursive; }
.simple_doublestrikethrough { text-decoration: line-through; color: red; }
.simple_doubleunderline { text-decoration: underline; color: red; }
.simple_dropcap { font-size : 6em; font-family: cursive; font-weight : bold; vertical-align: top; height: 1em; line-height: 1em; float : left; width : 1em; color : #c00; margin: 0em; padding: 0px; }
.simple_float { float:right; display: block; font-size: smaller; clear: right; padding: 4pt; width: 15%; }
.simple_hyphen { }
.simple_inline { display:inline; }
.simple_italic { font-style: italic; }
.simple_justify { text-align: justify; }
.simple_larger { font-size: larger; }
.simple_left { text-align: left; }
.simple_leftbraced { padding-left: 2pt; border-left: dotted gray 2pt; }
.simple_letterspace { letter-spacing: 0.5em; }
.simple_literal { font-family:monospace; white-space:pre; }
.simple_normalstyle { font-style:roman; }
.simple_normalweight { font-weight:normal; }
.simple_right { text-align: right; }
.simple_rightbraced { padding-right: 2pt; border-right: dotted gray 2pt; }
.simple_rotateleft { -webkit-transform: rotate(90deg); transform: rotate(90deg); }
.simple_rotateright { -webkit-transform: rotate(-90deg); transform: rotate(-90deg); }
.simple_rules { border: 1px solid black; padding: 2px;border-collapse:collapse;border-spacing:0; }
.simple_smallcaps { font-variant: small-caps; }
.simple_smaller { font-size: smaller; }
.simple_strikethrough { text-decoration: line-through; }
.simple_subscript { vertical-align: bottom; font-size: smaller; }
.simple_superscript { vertical-align: super; font-size: smaller; }
.simple_topbraced { padding-top: 2pt; border-top: dotted gray 2pt; }
.simple_typewriter { font-family:monospace; }
.simple_underline { text-decoration: underline; }
.simple_wavyunderline { text-decoration: underline; text-decoration-style: wavy; }
/* Model rendition styles */
.tei-supplied2:before { content:"<"; }
.tei-supplied2:after { content:">"; }
.tei-supplied3:before { content:"["; }
.tei-supplied3:after { content:"]"; }
.tei-supplied4:before { content:"("; }
.tei-supplied4:after { content:")"; }
.tei-supplied5:before { content:"{"; }
.tei-supplied5:after { content:"}"; }
.tei-signed1 { text-align: right; }
.tei-signed2 { font-style: italic; }
.tei-pb { display: block; margin-left: 4pt; color: grey; float: right; }
.tei-pb:before { content: '[Page '; }
.tei-pb:after { content: ']'; }
.tei-hi1 { font-weight: bold; }
.tei-hi2 { text-decoration: underline; }
.tei-hi3 { font-style: italic; }
.tei-hi4 { font-style: italic; }
.tei-code { font-family:monospace }
.tei-note2 { margin-left: 10px;margin-right: 10px; font-size:smaller; }
.tei-note3:before { content:" ["; }
.tei-note3:after { content:"] "; }
.tei-note3 { font-size:small; }
.tei-del { text-decoration: line-through; }
.tei-trailer { color: green; }
.tei-speaker { font-style:italic; }
.tei-figDesc:before { content: '[..'; }
.tei-figDesc:after { content: '..]'; }
.tei-figDesc { color: grey;font-style:italic; }
.tei-foreign { font-style:italic; }
.tei-email { font-family:monospace }
.tei-floatingText { margin: 6pt; border: solid black 1pt; }
.tei-table { font-size: smaller; background-color: #F0F0F0; }
.tei-address { margin-top: 2em; margin-left: 2em; margin-right: 2em; margin-bottom: 2em; }
.tei-author1:before { content: 'By '; }
.tei-castList { list-style: ordered; }
.tei-l { margin-left: 1em; }
.tei-closer { margin-top: 1em; margin-left: 1em; margin-left: 1em; }
.tei-p { text-align: justify; }
.tei-q1 { margin-left: 10px; margin-right: 10px; }
.tei-q2:before { content: '‘'; }
.tei-q2:after { content: '’'; }
.tei-q3 { margin-left: 10px; margin-right: 10px; }
.tei-docTitle { font-size: larger; }
.tei-stage { font-style: italic; }
.tei-titlePage { text-align: center; }
.tei-edition:before { content: 'Edition: '; }
.tei-div1 { border: 1px solid black; padding: 5px; }
.tei-add { color: green; text-decoration: underline; }
.tei-head2 { font-style: italic; }
.tei-head3 { font-style: italic; }
.tei-head4 { font-style: italic; }
.tei-head5 { font-weight: bold; }
.tei-unclear:after { content: ' [?] '; }
.tei-argument { margin-bottom: 0.5em; }
.tei-title5 { font-style: italic; }
.tei-title7 { font-style: italic; }
.tei-title9 { font-style: italic; }
.tei-title11 { font-style: italic; }
.tei-corr2:before { content: '['; }
.tei-corr2:after { content: ']'; }
.tei-sic2:before { content: '{'; }
.tei-sic2:after { content: '}'; }
.tei-addrLine { white-space: nowrap; }
.tei-gap1 { color: grey; }
.tei-gap2:before { content: '[..'; }
.tei-gap2:after { content: '..]'; }
.tei-gap2 { color: grey; }
.tei-gap3:before { content: '[...]'; }
.tei-quote1:before { content: '‘'; }
.tei-quote1:after { content: '’'; }
.tei-quote2 { margin-left: 10px; margin-right: 10px; padding-left: 10px; border-left: 1px solid #C0C0C0; }
.tei-row1 { font-weight: bold; }
.tei-gi { font-family: Menlo, Consolas, monospace; font-size: 0.85em; }
.tei-placeName1 { color: #e24329; font-variant: small-caps; }
.tei-placeName2 { color: #e24329; }
.tei-persName1 { color: #007e00; }
.tei-persName2 { color: #007e00; }
.tei-tag { font-family: Menlo, Consolas, monospace; font-size: .85em; }
.tei-tag:before { content: '<'; }
.tei-tag:after { content: '>'; }
\ No newline at end of file
This diff is collapsed.
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