Jump to content

error xml


Meshare

Recommended Posts

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
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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...