Lua return from function problem
snippet in lua

Lua return from function problem

user9118

function get_node_by_id (xml, nodeId)
    for i=1, #xml, 1 do
        if get_attr_by_name(xml[i], 'Id') == nodeId then
            print ("TRUEEEEE", i, xml[i])
            return xml[i]
        else
            local node = get_node_by_id(xml[i], nodeId)
            if node then return node end
        end
    end
end