manoelcampos / xml2lua

XML Parser written entirely in Lua that works for Lua 5.1+. Convert XML to and from Lua Tables 🌖💱
MIT License
290 stars 74 forks source link

get a nil value #20

Closed sameor closed 6 years ago

sameor commented 6 years ago

Hi, when I defin the xml string like below, and attempt to get person's name, it's return a nil value. I found it occured only has one person in the list of people. ` local xml = [[

University of Brasília Brasília-DF

]] local xml2lua = require("xml2lua") local handler = require("xmlhandler.tree") local parser = xml2lua.parser(handler) parser:parse(xml) for i, p in pairs(handler.root.people.person) do print(i, "Name:", p.name, "City:", p.city, "Type:", p._attr.type) end `

sameor commented 6 years ago

`

`