Giter VIP home page Giter VIP logo

fgsetxml's Introduction

fgsetxml project - 20170419

Description:

Yet Another Attempt - YAA to parse a FG aircraft set file, and show various parts of the content.

After writing xmlEnum, decided to apply that to a FlightGear aircraft set XML file, using the xmpParser library, started this fgsetxml project...

A previous attempt, fgxmlset project, used the libXML2 library, pull XML parsing, but that requires that you keep track of each open, data, close callbacks - WAY too difficult! I had already tried SG so called easyxml, but again this PULL parser seemed too difficult, so abandoned it...

Using the xmlParser library, I first wrote an xmlEnum app, to enumerate through ALL the nodes collected during the xmlParser file load, and this started to show me a way forward with this quite specialised aero-set.xml used in SG/FG... which can INCLUDE many other XML files, located in various places, some of which require FG_ROOT to be set (ENV or -r path option). This is the result.

The purpose here is to have a set of default XPaths to find, and show the results Like: sim/aircraft-version and show the text 2017.1, and so on... And that static list can be extended with the -x xpath option...

It was more difficult to enumerate all those nodes that begin with sim/multiplay/generic/float[n]|int[n]|string[n] since you do not know beforehand which will actually exist, so had to develop a special iterator for this - see void check_multiplay(XMLNode xnode, int dep, vSTG &vX);.

Could of course add all from the static list in the FG source, but that seems too much... and must be updated when that source is changed, which it did recently...

What I have now seems very messy, BUT it WORKS! ;=))

More xmlParser information - http://www.applied-mathematics.net/tools/xmlParser.html source: Download here: small, simple, multi-Plateform XMLParser library with examples (zipfile). version: v2.44: May 19, 2013 license: Aladdin Free Public License (Version 8, November 18, 1999) - see xmlParser/AFPL-license.txt copyright: Copyright (c) 2002, Frank Vanden Berghen - All rights reserved.

Building:

The building is using cmake to generate the desired build files.

So for a standard unix makefile build
$ cd build
$ cmake .. [-DCMAKE_INSTALL_PREFIX]
$ make
$ [sudo] make install (if desired)

For Windows, use the cmake GUI and set source directory, the binary directory to build, or with say msbuild from MSVC...

> cd build
> cmake .. [-DCMAKE_INSTALL_PREFIX]
> cmake --build . --config Release
> cmake --build . --config Release --target INSTALL (if desired)

Enjoy,
Geoff.
20170424

; eof

fgsetxml's People

Contributors

geoffmcl avatar

Stargazers

hltdev8642 avatar

Watchers

James Cloos avatar  avatar  avatar

fgsetxml's Issues

Support for an @input file...

Sometimes it is easier to put all the commands in an input file...

The suggestion would be to use say @input_file, which contained command options, space or line separated... And use the # character to begin a comment...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.