Validation of aircraft XML definition file#1038
Conversation
|
@bcoconni in terms of the order of elements within |
No I did change the order manually. It should indeed be feasible to write a script but I was afraid that it would change the tabulation layout of the files which would make the diff hardly legible. |
410fdac to
a6f27dc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1038 +/- ##
=======================================
Coverage 24.90% 24.90%
=======================================
Files 169 169
Lines 19669 19669
=======================================
Hits 4898 4898
Misses 14771 14771 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a6f27dc to
570c2bd
Compare
|
I've pushed an update to this (old) PR that allows using Let me know what you think. |
|
Looks good. |
|
Looks good. Green light to merge? |
|
Hi all,
Is it fully tested that aircraft that works in JSBSim (now) but do not pass
this test can simple be rearranged to pass the test?
I have some {air,sea}craft where I think the order of the different
sections (systems etc.) in the JSBSim files seem to be important.
Like these ones:
https://github.com/andgi/FlightGear-MTB_20m
https://github.com/andgi/FlightGear-Nordstern
https://github.com/andgi/FlightGear-ZNP-K
https://github.com/andgi/FlightGear-MFI-9
Cheers,
Anders
…On Mon, 22 Sept 2025 at 15:58, Agostino De Marco ***@***.***> wrote:
*agodemar* left a comment (JSBSim-Team/jsbsim#1038)
<#1038 (comment)>
Looks good. Green light to merge?
—
Reply to this email directly, view it on GitHub
<#1038 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDXMKQ2BDKJO5USSMQZVRD3T754FAVCNFSM6AAAAACHC3BWAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGMJZGIYDENJQGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Hi @andgi
This PR does not modify how JSBSim parses the XML files. So models will still behave the same way. The order in which the XML is parsed is hardcoded in JSBSim and is independent of the order in which the FDM sections are entered in the XML files. So the reordering that is needed to pass the XML validation should not alter how JSBSim runs the models.
We would be very interested in having examples that demonstrate the order-dependent behavior that you mentioned. If you could provide an FDM which gives different results based on the order in which the sections ( |
@agodemar @seanmcleod70 As far as I am concerned, the light is green. The issue that @andgi has reported is not affected by this PR, and the XML validation is optional. So users can elect not to pass the validation with our schemas (the Also I would suggest to address the topic mentioned by @andgi in a specific issue as soon as we get an example that demonstrates the XML order dependent behavior. |
|
Hi Bertrand and all others,
I will try to do that when I have time. It is a bit of work to reorder the
FDM files and find a good way to test the behaviour before and after.
Cheers,
Anders Gidenstam
|
This PR contributes to addressing the issue #155. It updates the XML validation document
JSBSim.xsdto (nearly ?) match the current state of aircraft definition files format. Some code has been moved fromJSBSimScript.xsdandJSBSimSystems.xsdtoJSBSimCommon.xsdto reduce redundancy.Disclaimer
That's a very long introductory comment for a PR and it will most likely be affected by the bike-shed effect a.k.a. law of triviality. I have mostly created it to initiate the discussion. There are a number of choices I made that certainly need to be reviewed and in all likeliness, I'll have to break this PR down into several PR's to make it easier to review.
Consider this PR as a basis for discussion. It is not meant to be merged as is. I have chosen the form of a PR because the changed files show what the result would look like.
Limitations
One of the main limitation to the XSD format is that it does not allow configurations where you could have as many sections as you want in whichever order that suits you. Actually one have to pick one option between the following ones:
<xs:sequence>: allows as many instances of each section as the user deems so but the order is imposed.<xs:all>: allows at most one instance of each section without restriction on the order in which they are listed.Limitations of
<xs:sequence>For example, using
<xs:sequence>if the following file validates:then the same file with a different order of sections is rejected:
Limitations of
<xs:all>Using
<xs:all>validates the following files:but rejects this file as there are 2 instances of
<output/>:Mitigation for JSBSim
In JSBSim there are a number of models that allows multiple
<output>elements or so. For such models the only available option is<xs:sequence>. The consequence is that for XML validation to succeed, an aircraft definition file must meet the following order:Notes
Results/Achievements
There are good reasons to validate XML files:
Modifications
Example
There was a great deal of variation (and creativity !) in the way in which
<fileheader>was filled. The proposed schema isNote XSD do not allow spaces around dates so you will find a number of changes such as:
There are a lot of changes of that kind, I will not review them in details here but I'd be happy to discuss them below.
Errors found
Extra
name="POINTMASS"There is a lot of occurrences of
<location name="POINTMASS"/>in<pointmass/>items. The attributenamein<location>is not used by JSBSim so I removed it.Extra
<product>around<table>There is a lot of occurrences of the following sequence of tags:
Here the
<product>item is useless as there is only one item provided (and<product>needs at least 2 to compute a result). In such a case, JSBSim issues a warning and ignores<product>but it is better if the extra<product>would be removed which I did.Ignored
<aerosurface_scale>In the aircraft
B747there is an<aerosurface_scale>that is included in a<kinematic>element. In such a case, JSBSim silently ignores<aerosurface_scale>. This was most likely a copy-paste error that can easily be detected by XSD schemasjsbsim/aircraft/B747/B747.xml
Lines 358 to 371 in 92daf89
Potato or Potato ? i.e.
<description>or<documentation>?There are a whole lot of occurrences of the
<documentation>tag which is illegal per the legacyJSBSim.xsd. As their name implies, these tags are for documentation and are plainly ignored by JSBSim. In this PR, I've followed the legacy and replaced all occurrences of<documentation>by<description>. Retrospectively I'd allow both so that there are less file modifications.I have also replaced all occurrences of
<description>under the<tank>element by XML comments<!-- -->(see the aircraftB17). There again, we could allow the occurrence of a<description>tag for<tanks>and that would reduce the size of the PR.