Welcome! Log In Create A New Profile

Advanced

XML problem with refresh page

Posted by rfocus_streamer 
XML problem with refresh page
April 14, 2016 08:56AM
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 !
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready