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

Use case for namespace overriding (from oasis-etm) #240

Open
ronaldtse opened this issue Jan 7, 2025 · 1 comment
Open

Use case for namespace overriding (from oasis-etm) #240

ronaldtse opened this issue Jan 7, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link
Contributor

ronaldtse commented Jan 7, 2025

The oasis-etm gem implements the OASIS ETM table structure, but NISO JATS uses a different namespace for the same structure.

How can we override the namespace?

Original:

namespace "-//OASIS//DTD XML Exchange Table Model 19990315//EN", "oasis"

Inside the niso-jats gem:

namespace "http://www.niso.org/standards/z39-96/ns/oasis-exchange/table", "oasis"

We clearly do not want to manually define a second set of classes, so either:

  • we find a way to create a tree of classes that have the namespace overridden
  • we find a way to modify the entire tree of classes of the namespace

Maybe the first solution is cleaner.

This is blocking:

@ronaldtse ronaldtse added the enhancement New feature or request label Jan 7, 2025
@HassanAkbar
Copy link
Member

@ronaldtse I have some ideas related to this,

  • We can use the default namespace by only defining it in the table class and then override the table class in all the gems we override.
  • We can add a method to update the namespace of all the child classes, something like apply_namespace("new-namespace"). It will look through all the serializable classes in the current object, recursively in all the children, and update their namespaces to new-namespace. We can also make to check for the namespaces overridden by mapping rules like map_element :th, to: :th, namespace: 'random-namespace' and update those as well based on a parameter.

What do you suggest?

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

No branches or pull requests

2 participants