Commit 526dc63d authored by Magdalena Turska's avatar Magdalena Turska

add test sample and tidy up names for offset alignment

parent adfea2a5
<?xml version="1.0" encoding="UTF-8"?>
<?teipublisher odd="teipublisher.odd" template="offset-alignment.html" view="div"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Abstract Alignment Sample</title>
</titleStmt>
<publicationStmt>
<p>Publication Information</p>
</publicationStmt>
<sourceDesc>
<p>Information about the source</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<group>
<text type="source">
<body>
<div>
<p>Some text here.</p>
<p>There.</p>
<p>And elsewhere.</p>
<div>
<p>Arbitrarily nested.</p>
<p>And whatnot.</p>
</div>
<div>
<p>And then some more.</p>
</div>
</div>
<div>
<div>
<p>Another.</p>
<div>
<p>Division there.</p>
</div>
<div>
<p>And elsewhere.</p>
<p>Foo bar.</p>
<p>Blah.</p>
</div>
<div>
<p> Bye bye.</p>
</div>
</div>
</div>
</body>
</text>
<text type="translation">
<body>
<div>
<p>T Some text <seg>here</seg> but not necessarily the same deeper structure.</p>
<p>T There.</p>
<p>T And elsewhere.</p>
<div>
<p>T Arbitrarily nested.</p>
<p>T And whatnot.</p>
</div>
<div>
<p>T And then some more.</p>
</div>
</div>
<div>
<div>
<p>T Another.</p>
<div>
<p>T Division there.</p>
</div>
<div>
<p>T And elsewhere.</p>
<p>T Foo bar.</p>
<p>T Blah.</p>
</div>
<div>
<p>T Bye bye.</p>
</div>
</div>
</div>
</body>
</text>
</group>
</text>
</TEI>
\ No newline at end of file
......@@ -43,8 +43,8 @@ declare function mapping:barum-book($root as element()) {
};
(:~ mapping trying to find a node in the same relation to the base of translation as current node to the base of transcription ~:)
declare function mapping:barum-offset($root as element()) {
declare function mapping:offset-translation($root as element()) {
let $node-id := util:node-id($root)
let $source-root := util:node-id(root($root)//tei:text[@type='source']/tei:body)
let $translation-root := util:node-id(root($root)//tei:text[@type='translation']/tei:body)
......@@ -53,6 +53,7 @@ let $offset := substring-after($node-id, $source-root)
let $node := util:node-by-id(root($root), $translation-root || $offset)
return
return
$node
};
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:i18n="http://exist-db.org/xquery/i18n">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"/>
<link rel="shortcut icon" type="image/x-icon" href="resources/images/favicon.ico"/>
<link rel="shortcut icon" type="image/png" href="resources/images/favicon-16.png" sizes="16x16"/>
<link rel="shortcut icon" type="image/png" href="resources/images/favicon-24.png" sizes="24x24"/>
<link rel="shortcut icon" type="image/png" href="resources/images/favicon-32.png" sizes="32x32"/>
<link rel="shortcut icon" type="image/png" href="resources/images/favicon-64.png" sizes="64x64"/>
<title data-template="config:app-title"/>
<meta name="description" content="Cortez Letter (Madrid)"/>
<meta name="pb-template" content="translation.html"/>
<link rel="stylesheet" type="text/css" href="resources/fonts/font.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald"/>
<script src="components/bower_components/webcomponentsjs/webcomponents-loader.js"/>
<link rel="import" href="components/dependencies-dev.html"/>
<style>
[unresolved] {
display:none;
}
</style>
<custom-style>
<style include="pb-common-styles">
body {
--pb-link-theme: {
font-family: "Junicode",Georgia,"Times New Roman",serif;
text-decoration: none;
color: black;
};
--pb-alternate-inline: var(--paper-blue-800);
--pb-view-height: calc(100vh - 192px);
}
#view1, #view2 {
flex: 1 1;
font-family: "Junicode", Georgia, "Times New Roman", serif;
font-size: 14pt;
line-height: 1.42857143;
max-width: 60vw;
margin: 0 16px;
max-height: var(--pb-view-height);
overflow: auto;
}
.content-body {
position: relative;
display: flex;
justify-content: center;
padding: 0 20px;
}
.content-body pb-view {
flex: 1 1;
}
.toc-toggle {
display: none;
}
</style>
</custom-style>
</head>
<body unresolved="unresolved" data-template="i18n:translate" data-catalogues="resources/i18n">
<pb-page data-template="pages:pb-page">
<pb-document id="document1" data-template="pages:pb-document"/>
<app-drawer-layout force-narrow="force-narrow">
<app-drawer data-template="templates:include" data-template-path="templates/drawer.html"/>
<app-header-layout>
<app-header slot="header" reveals="reveals" fixed="fixed" effects="waterfall" data-template="browse:fix-links">
<app-toolbar data-template="templates:include" data-template-path="templates/menu.html"/>
<app-toolbar data-template="templates:include" data-template-path="templates/toolbar.html"/>
</app-header>
<section class="breadcrumbs">
<pb-view id="title-view1" src="document1" xpath="//teiHeader" view="single">
<pb-param name="mode" value="title"/>
</pb-view>
</section>
<main class="content-body">
<pb-view id="view1" src="document1" xpath="//text[@type='source']/body" column-separator=".tei-cb" append-footnotes="append-footnotes" subscribe="transcription" emit="transcription"/>
<pb-view id="view2" src="document1" map="offset-translation" xpath="//text[@type='source']/body" subscribe="transcription" append-footnotes="append-footnotes"/>
</main>
</app-header-layout>
</app-drawer-layout>
</pb-page>
</body>
</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