nexusformat / definitions

Definitions of the NeXus Standard File Structure and Contents
https://manual.nexusformat.org/
Other
26 stars 55 forks source link

nxdlTypes: invalid xs:element for unit examples #1370

Closed woutdenolf closed 3 months ago

woutdenolf commented 4 months ago

Closes #1368

This is not valid (see https://www.w3schools.com/xml/el_element.asp)

<xs:element name="example">rad</xs:element>

This PR proposes

<xs:element name="example" type="xs:string" fixed="rad"></xs:element>

This validator detected the issue:

import xmlschema
xmlschema.XMLSchema("nxdl.xsd")

Should we add this to the tests?

woutdenolf commented 3 months ago

Define an "example" element instead (https://github.com/nexusformat/definitions/issues/1368#issuecomment-1988759366)