Meshare Posted February 27, 2013 Share Posted February 27, 2013 local xmlFile = xmlLoadFile ( "exampleFile.xml" ) if xmlFile then local node = xmlFindChild( xmlFile, "Name", 0 ) local success = xmlNodeGetValue ( node ) if success then for i,nodee in ipairs(success) do guiGridListSetItemText(List,row,1,tostring(nodee),false,true) end end end bad argument #1 to 'ipairs' (table expected, got string) i want up all Write in xml to list Link to comment
manve1 Posted February 27, 2013 Share Posted February 27, 2013 your getting the string of xmlNodeGetValue where the table should be, and i assume that you haven't seen the for looping in lua language. press here Link to comment
Meshare Posted February 27, 2013 Author Share Posted February 27, 2013 < Name> Test1 Test2 Test3 Name> Link to comment
manve1 Posted February 27, 2013 Share Posted February 27, 2013 for i,nodee in ipairs(success) do guiGridListSetItemText(List,row,1,tostring(nodee),false,true) end the bit of 'for' in the brackets is to get a table, you can as far as i know, not use a table, but should look something like this: local xmlFile = xmlLoadFile ( "exampleFile.xml" ) if xmlFile then local node = xmlFindChild( xmlFile, "Name", 0 ) local success = xmlNodeGetValue ( node ) if success then for i = success do guiGridListSetItemText(List,row,1,tostring(i),false,true) end end end 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