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

"definition" element enumeration #910

Closed
prjemian opened this issue Mar 29, 2021 · 3 comments · Fixed by #913
Closed

"definition" element enumeration #910

prjemian opened this issue Mar 29, 2021 · 3 comments · Fixed by #913
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

In https://github.com/nexusformat/definitions/blob/main/applications/NXspe.nxdl.xml, the definition field enumerates more than one valid representation of this application definition.

The XML Schema should control how many enumeration item field are allowed for the definition element. In our case, only one value is allowed, not zero (for an application definition), not more than one. The validation process can then properly deliver a message when a data file does not present this structure.

@prjemian prjemian added the bug label Mar 29, 2021
@prjemian prjemian added this to the NXDL 2021.10 milestone Mar 29, 2021
@prjemian
Copy link
Contributor Author

Additionally, we could allow any case presentation or the NXDL class name to pass validation. Those names that do not match exactly should be flagged as a warning but not marked as invalid.

The NIAC must ensure we do not allow multiple different NXDL classes that have the same name, differing only in case.

@prjemian
Copy link
Contributor Author

prjemian commented Mar 29, 2021

We should fix this situation in NXspe (in #911) by removing line 39:

<item value="NXSPE"/>

Make a new issue, PR, contact the community, and get approval from the NIAC.

@prjemian
Copy link
Contributor Author

The manual must make clear how to properly construct an NXDL file that connects this same name with the definition@name=".." attribute in the top-most element and the required enumeration element in the definition field below. This same name (and spelling, and upper/lower case representation) should match the file name. Consider putting this into the manual as a sidebar.

And, any content referenced by the NXDL (such as images) be placed in a subdirectory with the name chosen by stripping off the NX. (as in: NXDL for NXthing would be in file NXthing.nxdl.xml)

file: NXthing.nxdl.xml
resources: thing/image1.png

In the NXDL file:

<definition name="NXthing" ... />

<!-- later -->

        <field name="definition">
            <doc>Official NeXus NXDL schema to which this file conforms.</doc>
            <enumeration>
                <item value="NXthing"/>                
            </enumeration>
        </field>

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

Successfully merging a pull request may close this issue.

1 participant