Jump to content
The simFlight Network Forums

Read Data from a XML File and assign them to Variables in a Lua Script


Recommended Posts

Posted

Hello,

tried to find some helpful Informations here in the Forum and at Google. Unfortunally without Success.
So, i want to ask here, if it is possible to read Data from a XML File and assign them to Variables in a LUA Script?
An Example Code would also be highly appreciated.
 

Thanks in Advance and Greets from Germany
Joachim
 

FlugDaten.xml

Posted

I can't help you any more than google can with this. There seem to be various lua xml libraries available, so I don't think it would be too much of a problem, and you can maybe read as a txt file if you can determine where the data you require is held without parsing the xml.  But I don't have time to look into this any further, sorry.

John

Posted
56 minutes ago, Airbuspilot said:

if it is possible to read Data from a XML File and assign them to Variables in a LUA Script?

I just read such files as simple text files, and use the Lua string library to search for the keywords I'm interested in. The standard Lua string library contains all of the functions you'll need.

I'm afraid I've never investigated operating XML files with an XML editor or handler.

Pete

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.