RISCSoftware / cpacs_tigl_gen

Generates CPACS schema based classes for TiGL
Apache License 2.0
5 stars 5 forks source link

Order of CPACS elements in Sequences not correctly represented #21

Closed sdeinert closed 5 years ago

sdeinert commented 5 years ago

The writeCPACS methods of e.g. the ribsDefinition class are not created with the order that is prescribed by the Sequence defined in the XSD of the ribsDefinition element. Hence, in this example the child element ribCrosssection is always written before the ribsPositioning/ribExplicitPositioning elements causing validation errors with the schema.

Sequence order should be adhered to in the writeCPACS methods to avoid unnecessary schema conflicts.

bernhardmgruber commented 5 years ago

This problems actually already affects the type system built by the generator, as ReadCPACS and members of the generated class are in the wrong order as well. But I believe the problem is not too hard to solve. The child element iterating in SchemaParser.cpp has to be adapted to not e.g. iterate over all elements in a sequence and then over all choices. It has to iterate once over all children (in order) and do the appropriate thing.

@RlanderRISCSW do you want to fix this? Maybe I have time within the next weeks.

RlanderRISCSW commented 5 years ago

@bernhardmgruber thanks for your feedback and the solution proposal. I'll have a look at it as soon as I find time.