eeditiones / tei-publisher-app

The main TEI Publisher app
https://teipublisher.com
GNU General Public License v3.0
65 stars 33 forks source link

Output one list of notes for both transcription and translation in parallel views #40

Closed otichy closed 1 year ago

otichy commented 3 years ago

Hi!

I am using TEI Publisher 6 to display Old Czech texts in parallel with their translation, facsimile and notes. The structure of the XML is roughly this:

<TEI>
    <teiHeader></teiHeader>
    <facsimile></facsimile>
    <text>
        <front></front>
        <body>
            <div type="original">text <anchor n="s.1"/></div>
            <div type="translation">text <anchor n="t.1"/></div>
            <div type="notes"><note n="s.1">text</note> <note n="t.1">text</note></div>
        </body>
    </text>
</TEI>

I display the original, translation, facsimile and notes in parallel (based on the simplified odd and template for van gogh). The template displays the notes as:

<template title="Notes">
    <pb-view src="document1" xpath="//div[@type='original']"
        subscribe="transcription">
        <pb-param name="view" value="notes"/>
    </pb-view>
</template>

The odd uses a mode for div to list all notes for current page (in page view mode) like this:

<elementSpec ident="div" mode="change">
    <model predicate="$parameters?view='notes'" behaviour="inline">
        <param name="content" value="for $anchor in .//anchor/@n return  root($parameters?root)//div[@type='notes']//note[@n=$anchor]"/>
        <param name="type" value="'custom'"/>
    </model>
</elementSpec>

Unfortunately, this way I can only list notes based on the anchors either in the original text or in the translation (if I change the xpath in the template), but not of both together. I was able to display all notes together, but not per page changing the odd xpath from .//anchor/@n to root($parameters?root)//anchor/@n. I can also have two parallel divs in the template for two lists of notes.

However, what I want is one list of notes displaying notes from both the original and the translation per each page (in page view mode).

Is that feasible? Any hints would be greatly appreciated!

Best

Ondrej

tuurma commented 1 year ago

Sorry @otichy nobody answered before. This is a valid use case and certainly possible to achieve, just not a TEI Publisher issue as such. I'd suggest asking again on Slack, ideally with a short sample document and HTML template, then we can help out and make it into a TEI Publisher example. Closing the issue here though.