JATS4R / JATS4R-Participant-Hub

The hub for all JATS4R meeting notes, examples, draft recommendations, documents, and issues.
http://jats4r.org
17 stars 20 forks source link

Proposed recommending that all namespaces be defined on the root element #115

Closed Klortho closed 8 years ago

Klortho commented 8 years ago

This came up in our discussion this morning. We noticed that the ali namespace attribute is allowed both on <article> and on the ali elements. It was suggested that JATS4R recomment that these always be put onto the <article> element. Any objections?

vincentml commented 8 years ago

I agree with adding all namespace prefix definitions to the root element.

However, certain tools might require the MathML namespace definition to be attached to the mml:math element and that might need some investigation.

Klortho commented 8 years ago

I'm not aware of any tools like that, but of course you are right that some tools might require them. And it is true that if the namespace is defined outside the element that uses it, then you can't just copy-paste that element block into another document, and expecte it to work.

There's no reason that the namespace element couldn't be defined in both places. I.e., this is perfectly good XML:

<article dtd-version="1.0" xmlns:mml="http://www.w3.org/1998/Math/MathML">
  ...
  <mml:math display="inline" xmlns:mml="http://www.w3.org/1998/Math/MathML">
  ...

So, we could recommend that all namespaces be defined on the root element, and add a note that they could also define them on the target element, if they need it there. Do you think that's a good idea?

hubgit commented 8 years ago

certain tools might require the MathML namespace definition to be attached to the mml:math element

Which (broken) tools are those?

jeffbeckncbi commented 8 years ago

I’m sorry I missed the call. I will try to be more active in the upcoming months.

I think that we need to discourage making rules that are restrictions of the XML Specification for the convenience of writing the validator. XML allows the namespace declarations to be where they need to be – and the DTDs allow for this in their clumsy way.

I can think of no tool that requires the MathML namespace declaration to be on each mml:math element, but I can think of some valid workflows where the math content comes from math editors with the declaration in place and removing it would be extra (unnecessary until we make this rule) work.

So I can think of no non-broken tools that would require the declarations on the math elements, but if we have a tool that does not allow them there, people may start asking for a non-broken JATS4R validator.

From: Alf Eaton notifications@github.com<mailto:notifications@github.com> Reply-To: JATS4R/JATS4R-Participant-Hub reply@reply.github.com<mailto:reply@reply.github.com> Date: Friday, October 2, 2015 at 10:41 AM To: JATS4R/JATS4R-Participant-Hub JATS4R-Participant-Hub@noreply.github.com<mailto:JATS4R-Participant-Hub@noreply.github.com> Subject: Re: [JATS4R-Participant-Hub] Proposed recommending that all namespaces be defined on the root element (#115)

certain tools might require the MathML namespace definition to be attached to the mml:math element

Which (broken) tools are those?

— Reply to this email directly or view it on GitHubhttps://github.com/JATS4R/JATS4R-Participant-Hub/issues/115#issuecomment-145043467.

hubgit commented 8 years ago

Absolutely - I agree that the namespaces should be allowed anywhere in the document.

Klortho commented 8 years ago

It would be fine with me to just drop this idea, but I want to be sure you understand exactly what the proposal is. I'm not suggesting we disallow namespace declarations on <mml> or any other element; I'm suggesting that we recommend that if they are used, then they (perhaps also) be declared on the root element.

As I write this, I realize that even that is probably a bad idea -- it will probably just cause more confusion, and probably not provide any benefits to anyone.