Commit 43b13648 authored by Magdalena Turska's avatar Magdalena Turska

add mapping for translations

parent f4761886
Pipeline #287 canceled with stages
......@@ -251,6 +251,8 @@ declare variable $config:app-root :=
;
declare variable $config:data-root :=$config:app-root || "/data";
declare variable $config:translations-root :=$config:app-root || "/translations";
declare variable $config:data-exclude := "taxonomy.xml";
......
......@@ -6,6 +6,7 @@
module namespace mapping="http://www.tei-c.org/tei-simple/components/map";
import module namespace nav="http://www.tei-c.org/tei-simple/navigation/tei" at "navigation-tei.xql";
import module namespace config="http://www.tei-c.org/tei-simple/config" at "config.xqm";
declare namespace tei="http://www.tei-c.org/ns/1.0";
......@@ -20,6 +21,13 @@ declare function mapping:vg-translation($root as element()) {
$node
};
declare function mapping:dodis-translation($root as element()) {
(: let $id := ``[pb-trans-`{$root/@f}`-`{$root/@n}`]``:)
let $file := substring-before(util:document-name($root), '.xml')
return
doc($config:translations-root || '/' || $file || '-en.xml')//tei:text
};
declare function mapping:cortez-translation($root as element()) {
let $first := (($root/following-sibling::text()/ancestor::*[@xml:id])[last()], $root/following-sibling::*[@xml:id], ($root/ancestor::*[@xml:id])[last()])[1]
let $last := $root/following::tei:pb[1]
......
......@@ -131,7 +131,7 @@
<paper-icon-button icon="icons:close"/>
</pb-grid-action>
<template title="Translation">
<pb-view src="document1" map="vg-translation" xpath="//div[@type='original']" subscribe="transcription"/>
<pb-view src="document1" map="dodis-translation" xpath="//text" subscribe="transcription"/>
</template>
<template title="Facsimile">
<pb-facsimile subscribe="transcription" type="image">
......@@ -157,4 +157,4 @@
</app-drawer-layout>
</pb-page>
</body>
</html>
</html>
\ No newline at end of file
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