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

Using @key attribute in inserted annotation references instead of @ref? #207

Open
daliboris opened this issue Nov 26, 2023 · 1 comment
Open

Comments

@daliboris
Copy link
Contributor

daliboris commented Nov 26, 2023

Annotation feature in TEI Publisher creates in the registry (registry.xml file) an element with @xml:id attribute:

<place xml:id="geo-6946437">
   <placeName type="full">Basilika San Francisco</placeName>
   <!-- ... -->
</place>

Value of this attribute is referenced from the text using @ref attribute:

<placeName ref="geo-6946437">San Francisco</placeName>

According to the specification and examples, @ref is of type teidata.pointer and should use a URI, a prefix declared in prefixDef element, or point to an existing element using #.

If the identifier resolution system is external, the @key attribute shoul be used.

It seems to me that TEI Publisher uses it's own system (i.e. external) to identify referenced enetity and thus it should generate @key attribute in the text.

@daliboris
Copy link
Contributor Author

daliboris commented Apr 15, 2024

The name of the attribute is configurable in the annotation-config.xqm module.

declare variable $anno:reference-key := 'ref';

The problem with the hash (#) prefix in teidata.pointer can be solved in the anno:get-key() function (in the same module):

declare function anno:get-key($node as element()) as xs:string? {
    let $key := $node/@*[local-name(.) = $anno:reference-key]
    return if(starts-with($key, '#')) then substring-after($key, '#') else $key
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant