Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MEI support: annotation title and eutil:getLocalizedTitle #311

Open
bwbohl opened this issue May 9, 2023 · 0 comments
Open

MEI support: annotation title and eutil:getLocalizedTitle #311

bwbohl opened this issue May 9, 2023 · 0 comments

Comments

@bwbohl
Copy link
Member

bwbohl commented May 9, 2023

When converting an annotation to JSON the annotation module call the generic eutil:getLocalizedTitle function:

let $genericTitle := eutil:getLocalizedTitle($anno, $lang)

The function is quite generic and returns the text of a title element:

declare function eutil:getLocalizedTitle($node as node(), $lang as xs:string?) as xs:string {
let $namespace := eutil:getNamespace($node)
let $titleMEI := if ($lang != '' and $lang = $node/mei:title/@xml:lang)
then ($node/mei:title[@xml:lang = $lang]//text() => string-join() => normalize-space())
else (($node//mei:title)[1]//text() => string-join() => normalize-space())
let $titleTEI := if ($lang != '' and $lang = $node/tei:title/@xml:lang)
then $node/tei:title[@xml:lang = $lang]/text()
else $node/tei:title[1]/text()
return
if ($namespace = 'mei')
then($titleMEI)
else if ($namespace = 'tei')
then($titleTEI)
else('unknown')
};

Concerning mei:annot the presence of mei:title already was a workaround in Edirom Online based on MEI 2.1.1 (2013( due to the unavailability of mei:head in mei:annot, as by definition mei:title is (and was) defined as: “Title of a bibliographic entity.”

If applicable, we should look for mei:head in this context.

@daniel-jettka daniel-jettka changed the title annotation title and eutil:getLocalizedTitle MEI support: annotation title and eutil:getLocalizedTitle May 22, 2024
@krHERO krHERO moved this to Backlog in Edirom Development Jul 3, 2024
@bwbohl bwbohl added this to the 1.0.0 milestone Sep 6, 2024
@bwbohl bwbohl modified the milestones: 1.0.0, 1.1.0 Dec 4, 2024
@krHERO krHERO modified the milestones: 1.1.0, 1.2.0 Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants