David Megginson wrote:
 > Andy Ross writes:
 > > The reason this bites only YASim, I suspect, is that I'm the only
 > > non-SimGear code that actually uses this file.  Everything else uses
 > > the PropertyTree "wrapper" parser instead.  I didn't know about this
 > > at the time, so I just used the raw SAX-like parser instead.
 >
 > Andy -- your XML looks fine, and a property-based version would be
 > more verbose, but if you'd like the extra flexibility (and
 > consistency), I'll be happy to help you switch over.

The advantage to the property interface, to me, isn't so much that the
configuration would end up in the property system (nothing but the
YASim parser should ever be touching the aircraft configuration files
at runtime, anyway).  It's that you get a single "parse tree" as the
output, instead of having to handle things piecemeal in callbacks.

I tend to agree -- the property scheme would be more verbose and less
readable than attributes.  Quite honestly, I'm not a big fan of XML
for this reason; it's data model doesn't quite fit the one most
programs use internally.  The choice as to use an attribute or subtag
is very non-orthogonal, ordering constraints for sub-parts is only
implied (this makes "list of N or more" constructs a little clumsy),
there's the nasty possibility that you will have data in places you
don't want, whitespace handling is nonspecified (i.e. is "<a> 2.3
</a>" equal to "<a>2.3</a>" or not?).  I could go on with a bunch of
complaints and nits.

On the other hand, it's a standard metadata format with readily
available parsers for every programming environment imaginable, and
this world *DESPERATELY* needs a standard metadata format.  So I live
with it without complaining too much.  It just isn't what I would have
picked. ;)

Andy

-- 
Andrew J. Ross                NextBus Information Systems
Senior Software Engineer      Emeryville, CA
[EMAIL PROTECTED]              http://www.nextbus.com
"Men go crazy in conflagrations.  They only get better one by one."
 - Sting (misquoted)



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to