How is a derived type affected by tag order?
When dealing with types that are derived from other types, the order is important in validating. For instance, if the schema has PersonGivenName before PersonSurName, it would not validate if the sequence is switched. How does a derived type get affected by this? For example, CaseOfficial is a CaseOfficialType. CaseOfficialType is derived from SuperType, PersonType, and JudicialOfficialType.
What should be the order of tags from any of the Base types should be so that the xml file still validates? The rule is that parent properties (in sequence) always come first. So, since CaseOfficialType extends JudicialOfficialType extends PersonType extends SuperType, then a CaseOfficial will have element properties defined in SuperType PersonType JudicialOfficialType CaseOfficialType, in that order, and sequenced as in each respective type. Attribute properties can be used in any order. T here has been much discussion and no resolution other than a recommendation to use sequence as the GJXDM suggests on where reference PersonGivenName is before PersonSurName .
There are several groups and individuals who believe that element sequence within a type is an unnecessary restriction. However, it depends upon how the instance is processed. If the program/parser traverses the hierarchy looking for each element in the hierarchy in sequence (PersonName, PersonSurName, PersonGivenName) then one must retain the sequence in your instances or the program/parser breaks. Those in favor of not validating based upon sequence consider this an antiquated restriction and a processing problem, not an XML problem. If the program/parser looks for Subject and then looks for PersonName and PersonSurName and PersonGivenName are unique within PersonName there does not have to be any particular sequence. As one goes up the hierarchy, PersonName should not have to appear in any particular order within Subject (a PersonType) but it must appear within Subject or it loses context.