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

change xmlns declarations to be generated using computed namespace constructors #40

Closed
wlpotter opened this issue Dec 8, 2021 · 0 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation priority

Comments

@wlpotter
Copy link
Owner

wlpotter commented Dec 8, 2021

I was not using computed element constructors as I did not realize namespaces could be dynamically constructed. A better way to handle this is to have somewhere in the config (I think) a list of the namespaces that should occur based on the entity type.

This can be created in the config module and used by the transform and templating scripts to dictate the output of the xmlns declarations on the TEI element (this avoids any duplication in the sub-elements).

The current setup does not allow entity-specific customization of which namespaces are declared on the TEI root element. Changing to something like the below should be much more useful

<listNamespace>
    <namespace prefix="srophe" entity="all">http://srophe.app</namespace>
    <namespace prefix="svg" entity="persons places">http://www.w3.org/2000/svg</namespace>
    <namespace prefix="skos" entity="subjects">http://www.w3.org/2004/02/skos/core#</namespace>
</listNamespace>

In config, then, loop through the namespace elements, test if @entity is all or the one selected and add create a namespace using

namespace {$prefix} {$text-node}

This list of prefixes can then be added to the element constructor for the TEI root element.

Priority because of #39

@wlpotter wlpotter added bug Something isn't working documentation Improvements or additions to documentation priority labels Dec 8, 2021
@wlpotter wlpotter self-assigned this Dec 8, 2021
wlpotter added a commit that referenced this issue Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation priority
Projects
None yet
Development

No branches or pull requests

1 participant