Board index FlightGear Development Aircraft

JSBSim xml tag attribute errors (and more)

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

JSBSim xml tag attribute errors (and more)

Postby MariuszXC » Tue Nov 29, 2022 11:55 am

While trying to get a better overview of a structure of an existing model I got several XML errors complaining, that some attributes or tags were not correct.
For example:
Code: Select all
<system name="...">
  <property value="0.0">/some/property</property>
  ...

would complain because "cvc-type.3.1.1: Element 'property' is a simple type, so it cannot have attributes.."

Another place was:
Code: Select all
<channel name="Lights" execrate="5">

with a complaint "cvc-complex-type.3.2.2: Attribute 'execrate' is not allowed to appear in element 'channel'."

Next is probably just an error on model creator side and easy to fix:
Code: Select all
<channel name="...">
  <pure_gain>

which complains because: "Attribute 'name' is missing from element 'pure_gain'."

but this one not so much (unless programmer's error too):
Code: Select all
<channel name="...">
  <pure_gain>
    <input>/some/property</input>
    <gain>0.123</gain>
    <clamp>
      <min>0.0</min>
      ...

because: Element name 'clamp' is invalid. One of the following is expected: - clipto, - output. Error indicated by: {the schema}

Then there is:
Code: Select all
...
<actuator>
  <input>...</input>
  <rate_limit>...</rate_limit>
  <output>/first/property</output>
  <output>/second/property</output>
</actuator>

which complains about second <output> statement as not allowed, but it seems to work nevertheless..

And more:
Code: Select all
<aerosurface_scale name="...">
  <input>/some/property</input>
  <zero_centered>false</zero_centered>

which says: Element name 'zero_centered' is invalid. One of the following is expected: - domain - range - gain - clipto - output. Error indicated by: {the schema}

Also some math functions appear to be unknown:
Code: Select all
<function>
  <ln>
  ...

will complain about <ln> being not allowed by the schema (same goes for <exp>, <log10>).

The document references:
Code: Select all
<fdm_config name="x" version="1.1" release="ALPHA"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
...


My question is, if perhaps there is an updated schema for JSBSim?
I found a thread, almost a decade old, which admits that the schema may lag behind the code a bit, but maybe things changed since then?

Ref: viewtopic.php?f=66&t=18622&p=173746&hilit=jsbsim+schema#p173676
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: JSBSim xml tag attribute errors (and more)

Postby AndersG » Wed Nov 30, 2022 8:06 am

The schema is an approximation of what JSBSim can do. It is not used when JSBSim is compiled. One think I remember is missing in the schema is all ways the different sections can be ordered in JSBSim and the order can be important, e.g. the ordering of different <system ...> when computing a frame.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: JSBSim xml tag attribute errors (and more)

Postby MariuszXC » Wed Nov 30, 2022 11:41 am

Thank you for chimming in.
I noticed that the parser is very lenient towards the document :)
Main reason for this topic was me being slightly annoyed with an XML plugin in my IDE complaining about the 'errors' in the document, I'll just ignore those from now, although I normally try to pay attention to syntax warnings.

If you have time, could you expand on the sections and systems ordering? Does it have performance implications and/or may lead to race condidtions?
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: JSBSim xml tag attribute errors (and more)

Postby TheEagle » Wed Nov 30, 2022 1:10 pm

try changing the version attribute in the fdm-config tag to 2.0 ! :)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: JSBSim xml tag attribute errors (and more)

Postby MariuszXC » Wed Nov 30, 2022 1:38 pm

Tried, did not help.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: JSBSim xml tag attribute errors (and more)

Postby Necolatis » Mon Dec 05, 2022 2:31 pm

That schema is old.

But you have a real error: <clamp> should be <clipto>

See the updated documentation for pure gain here: https://jsbsim-team.github.io/jsbsim/cl ... GGain.html
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: JSBSim xml tag attribute errors (and more)

Postby MariuszXC » Tue Dec 06, 2022 1:01 pm

Yes, I found it, but thanks for pointing out.
This was part of reason behind my posting. I try to pay attention to warnings coming from syntax checkers etc. They are there for a reason. Having an outdated schema forces me to either ignore those warnings, or check each and every of them if they are spurious or real - which means extra time spent on this task, time which could be spent in a more creative way :-)
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: JSBSim xml tag attribute errors (and more)

Postby wkitty42 » Tue Dec 06, 2022 2:03 pm

i'd like to know where the schemas (DTD?) are located so i can point xmlstarlet to them and avoid having to preprocess all the XML files to strip out the DTDs...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: JSBSim xml tag attribute errors (and more)

Postby MariuszXC » Tue Dec 06, 2022 6:58 pm

They are referenced in a header. In my case in jsb fdm config:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://jsbsim.sourceforge.net/JSBSim.xsl"?>

<fdm_config name="X" version="2.0" release="ALPHA"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: JSBSim xml tag attribute errors (and more)

Postby wkitty42 » Tue Dec 06, 2022 8:11 pm

ahhh... ok... i'm more looking for the DTD(?) ones that are everywhere and cause xmlstarlet quite the ugh... sorry if i mixed them up...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 18 guests