Chronic Posted July 14, 2014 Share Posted July 14, 2014 Hey guys, I'm really not getting this I'm wondering if anyone can explain this to me. Outputs true, so the file exists: outputChatBox ( tostring ( fileExists ( "files/settings.xml" ) ) ) However, this outputs false, and I don't understand why. local xml = xmlLoadFile ( "files/settings.xml" ) outputChatBox ( tostring ( xml ) ) The xml file looks like this: <settings rAccount="true" username="dkjslkd" password="ddsldklsd"></settings> Link to comment
12p Posted July 14, 2014 Share Posted July 14, 2014 In first place, your XML should look like this, because in every XML there NEEDS to be a parent node. <settings> <setting rAccount="true" username="dkjslkd" password="ddsldklsd" /> </settings> In second place, I don't know what you're trying to achieve with that Lua code, but it will only output a string of the raw data value of the element that your XML node is. Easier way around: you'll get a load of text that will make no sense. Use the following functions for a profitable code: xmlNodeGetChildren xmlNodeGetAttribute Link to comment
Chronic Posted July 14, 2014 Author Share Posted July 14, 2014 I don't think it matters what I'm trying to achieve, I was just testing if the XML loaded properly, which it didn't. Your XML file didn't work either, it still won't load. Link to comment
12p Posted July 14, 2014 Share Posted July 14, 2014 Did you add the file to meta.xml? Link to comment
Chronic Posted July 14, 2014 Author Share Posted July 14, 2014 Nevermind, I fixed it. Thanks for your help anyway. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now