Jump to content
The simFlight Network Forums

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


Airbuspilot
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.