local inspect = require("inspect")
local xml2lua = require("xml2lua")
local tree_handler = require("xmlhandler.tree")
local message_handler = tree_handler:new()
local parser = xml2lua.parser(message_handler)
local stanza = [[<message><ext><from n='name1' res='res1'/></ext></message>]]
parser:parse(stanza)
print(inspect(message_handler.root.message))
It outputs:
{ ext = { from = { _attr = { res = "res1" } } } }.
But if I simply change the n to nd, it outputs as expected:
{ ext = { from = { _attr = { nd = "name1", res = "res1" } } } }
It outputs:
{ ext = { from = { _attr = { res = "res1" } } } }
.But if I simply change the
n
tond
, it outputs as expected:{ ext = { from = { _attr = { nd = "name1", res = "res1" } } } }