Is element order a thing in XML? That is is the order of appearance of sibling elements within an XML document critical?
https://stackoverflow.com/questions/28268696/is-the-order-of-two-siblings-implementation-dependent
https://xmltutorial.info/xml/node-relationships/
Here is the response from the XSD author:
I haven’t read the entire thread, but I take it the question is whether elements in a mods record need to be in a particular order (i.e. in the order that they are listed in the schema). They don’t.
In the MODS schema, look for:
*********************************************************************** ** Definition of a single MODS record ** **********************************************************************
And following that:
<xs:element name="mods" type="modsDefinition"/>
<!-- -->
<xs:complexType name="modsDefinition">
<xs:group ref="modsGroup" maxOccurs="unbounded"/>
……….
This says: a MODS record consists of one or more elements from the “modsGroup (at least one, because that is the default if there is no minOccurs, and as many as you want because maxOccurs=“unbounded”) enclosed within a element.
Next, look for:
*********************************************************************** ** These are the "top level" MODS elements ** ********************************************************************** —>
prior to that:
<xs:group name="modsGroup”>
<xs:choice>
…. and following it is the list of elements:
<xs:element ref="abstract"/>
<xs:element ref="accessCondition"/>
<xs:element ref="classification"/>
<xs:element ref="extension"/>
<xs:element ref="genre"/>
<xs:element ref="identifier"/>
<xs:element ref="language"/>
<xs:element ref="location"/>
……………. and so on.
“Choice: says “choose any one of these elements."
So all together, it says choose an elements from the list. Any element. And then repeat as desired.
So you could choose “genre”, and then choose “classification”, and so on. Chosen in no particular order.
And then enclose your list within a
<mods>
record, in the order in which you chose the elements.
Ray