The require
idiom you have used is the one recommended for Lua 5.2. Although the idiom also works for Lua 5.1, most (but not all) libraries for Lua 5.1 usually defined globals and did not return the value they define via require
. In the absence of a return value from a luaopen_xxx
function, require
returns true, hence the error message you've seen.
So, just use simply require("luaXml")
, don't assign it to a local.