Hello, I use Lua code for XML file but I get problem ( error 500 ) when I try to get more then once some atribute.
here is a my code :
rewrite_by_lua '
require("LuaXml")
local xfile = xml.load("test.xml")
local xscene = xfile:find("scene")
ngx.say(xscene.id)
';
First time work fine, but next time when I going to refreshing location I get error :
lua entry thread aborted: runtime error: rewrite_by_lua(nginx.conf:41):3: attempt to index global 'xml' (a nil value)
stack traceback:
coroutine 0:
rewrite_by_lua(nginx.conf:41):3: in function <rewrite_by_lua(nginx.conf:41):1>, client: 127.0.0.1, server: localhost, request: "GET /testlua HTTP/1.1", host: "127.0.0.1:8080"
Please help me to resolve this problem !
here is a my code :
rewrite_by_lua '
require("LuaXml")
local xfile = xml.load("test.xml")
local xscene = xfile:find("scene")
ngx.say(xscene.id)
';
First time work fine, but next time when I going to refreshing location I get error :
lua entry thread aborted: runtime error: rewrite_by_lua(nginx.conf:41):3: attempt to index global 'xml' (a nil value)
stack traceback:
coroutine 0:
rewrite_by_lua(nginx.conf:41):3: in function <rewrite_by_lua(nginx.conf:41):1>, client: 127.0.0.1, server: localhost, request: "GET /testlua HTTP/1.1", host: "127.0.0.1:8080"
Please help me to resolve this problem !