I posted this on the JSBSim list, but I think it applies here, as well.
Substitute "Flightgear" for "JSBSim"...

Jon
===

As the number of XML files of various kinds (aircraft, engine models, etc.)
starts to grow, I'm beginning to think that some kind of run-time validation
of the input files could be very helpful. It's hard to catch all kinds of
possible errors that might be made in a configuration file - whether it be
in layout of the XML file, or content type, or out-of-limits data. Often,
these kinds of errors result in either bad operation, or segfaults. That's
not good for anyone.

Luckily, there are a growing number of command-line tools that will do
various kinds of operations on XML files. XMLStarlet is one of those that
I've been using. It's not perfect, yet, but it seems to work well enough for
my purposes. This tool can perform XSL transformations on an XML file, or
validate it based on a schema, etc. It's also quite fast.

It seems to me that it should be workable to provide an option whereby a
validation against a schema could take place - if desired or as an option -
on each XML file loaded, the first time it is loaded. In code, this could be
done simply by checking to see if an option is supplied on the command line,
or if an environment variable is set, perhaps pointing to the XML validation
tool to use, and the path. Such a feature should be coded to compile across
platforms, of course, and to provide a message if the capability is not
available.

I think this capability could be added without much code overhead at all,
and would make JSBSim much more robust in the hands of new users.

Comments?

Jon

Jon S. Berndt
Development Coordinator
JSBSim Project
www.JSBSim.org



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to