cstb / citygml-energy

CityGML Energy ADE
43 stars 9 forks source link

Order of object attributes in XSD file #97

Closed RomainNouvel closed 8 years ago

RomainNouvel commented 8 years ago

Hi, I wonder how have been ordered the attributes of the different objects, and if there is a way to list them alphabetically, in order to find out quickly the different attributes and possible XML errors

oliviertournaire commented 8 years ago

Agree. Isn't it there a way to avoid the constraints on element ordering directly in XSD? @JoachimBenner any idea?

JoachimBenner commented 8 years ago

Yes, there is a technique to avoid the constraints of element ordering (e.g. gmXML or IfcXML use it), but I would strongly recomment not to use it. A formal argument is that this encoding is not ISO conformant. A very practical argument is that with this encoding a schema validator looses the possibility to distinguish between "optional" and "mandatory" child elements, all child elements are optional. Thus, a schema validation would be of very limited worth to ensure that an instance model is really valid. From my point of view this is a significant drawback.

The EnergyADE is an extension of CityGML, and in CityGML the element order is significant. Thus, where is the real benefit to avoid the constraint in the extension, but not in the base standard? This will surely puzzle users and software developers. To stick to a specific element order is only a problem in case an XML file is manually generated with a simple text editor. A proper software would automatically ensure the correct element ordering.

On the other hand, I don't see a

RomainNouvel commented 8 years ago

Ok Joachim. Concerning the order of the attributes, do you agree with a alphabetical order? Does this represent a problem to update ? Regards, Romain

JoachimBenner commented 8 years ago

For me, the order of attributes in the XSD-File is irrelevant. If we want alphabetical property ordering (why???), this means a lot of manual work in adapting the sequenceNumber Tagged Values of all properties in (almost) all UML elements. Furthermore, all existing sample models will become invalid. Who shall do this huge amount of (in my eyes irrelevant) work?

oliviertournaire commented 8 years ago

Agree!