You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only difference in them is the .ssd file inside, where in the "works.ssp" we have a ParameterBindings object at the top:
<ssd:System name="Root">
<ssd:ParameterBindings>
<ssd:ParameterBinding source="resources/52fa3348-3287-4807-a940-dd1108feebdb.ssv"/>
</ssd:ParameterBindings>
(the rest of the System xml)
</ssd:System>
While in the error.ssp, we have it at the end:
<ssd:System name="Root">
(the rest of the System xml)
<ssd:ParameterBindings>
<ssd:ParameterBinding source="resources/52fa3348-3287-4807-a940-dd1108feebdb.ssv"/>
</ssd:ParameterBindings>
</ssd:System>
We're seeing the following validation error:
warning: invalid "SystemStructureDescription" detected in file "error.ssp" at line: 601 column: 18, element 'ParameterBindings' is not allowed for content model '(Connectors?,ElementGeometry?,ParameterBindings?,Elements?,Connections?,SignalDictionaries?,SystemGeometry?,GraphicalElements?,Annotations?)' warning: "SystemStructureDescription" does not conform to the SSP standard schema
From XML specifications: Generally speaking, the order in which child elements appear inside their parent element container in XML shouldn't matter
I believe OMSimulator's xml validator should not print warnings in the console (and possibly ignore content) if the order is different. After all, XML generally speaking allows elements to appear in any order.
@GorbadPS3 The schema is validated against SSP specification 1.0, We earlier supported different ordering of SSD elements, but then our ssp's do not load in https://www.easy-ssp.com/ tool, So currently the ssp's are validated according to SSP specification 1.0 and we generate only warnings and still the simulation continues. So the validation is done according to schema in https://github.com/modelica/ssp-standard
Description
It appears the order of XML elements in the SSD file matters for the XML validation parser. I have two identical .ssp models:
models_here.zip
The only difference in them is the .ssd file inside, where in the "works.ssp" we have a ParameterBindings object at the top:
While in the error.ssp, we have it at the end:
We're seeing the following validation error:
warning: invalid "SystemStructureDescription" detected in file "error.ssp" at line: 601 column: 18, element 'ParameterBindings' is not allowed for content model '(Connectors?,ElementGeometry?,ParameterBindings?,Elements?,Connections?,SignalDictionaries?,SystemGeometry?,GraphicalElements?,Annotations?)' warning: "SystemStructureDescription" does not conform to the SSP standard schema
From XML specifications:
Generally speaking, the order in which child elements appear inside their parent element container in XML shouldn't matter
I believe OMSimulator's xml validator should not print warnings in the console (and possibly ignore content) if the order is different. After all, XML generally speaking allows elements to appear in any order.
Steps to reproduce the behavior
Run:
OMSimulator.exe --startTime=0.0 --stopTime=0.1 works.ssp
And:
OMSimulator.exe --startTime=0.0 --stopTime=0.1 error.ssp
(note: You can ignore the calculation errors of the simulation models provided: They are dummy FMU models)
You'll notice that for the "error.ssp" OMSimulator warns about the ParameterBindings, but not for the "works.ssp".
Expected behavior
The parsing of the XML should not warn about invalid elements if they appear in a different order.
Version and OS
OMSimulator.exe --version
OMSimulator v2.1.2.post6-g637a1c9-win-notlm
OS: Windows 11, 64-bit.
The text was updated successfully, but these errors were encountered: