FAIRmat-NFDI / nyaml

https://fairmat-nfdi.github.io/nyaml
https://pypi.org/project/nyaml/
Apache License 2.0
1 stars 0 forks source link

Order of elements matters but that is not documented #20

Open mkuehbach opened 5 months ago

mkuehbach commented 5 months ago

Scope: nyaml converts a NeXus schema written in YAML into an NXDL.XML

Observation: The order of childs to elements matters as observed when running make test on www.github.com/FAIRmat-NFDI/nexus_definitions make test for the following exemplar yaml and respective nxdl.xml application definition test files.nyaml2nxdl_order_matters.zip

My understanding The reason is that childs of fieldType in nxdl.xsd are defined as childs of an xs:sequence not an xs:all https://www.wilfried-grupe.de/XSD3_10.html

Necessary steps

Further relevance Also members and capabilities of NXDL that are less frequently used by current FAIRmat-specific NeXus proposals use internally the xs:sequence environment.

lukaspie commented 3 months ago

Another point where this comes up: the nxdl specification requires the dimensions to be declared before any other attributes.

My suggestion: the ordering in the nyaml file can possibly be arbitrary, but the nyaml2nxdl forward tool should make sure that the ordering in xs:sequence is respected.