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

broken testxml.lua and xmlhandler/dom.lua #19

Closed hhrhhr closed 6 years ago

hhrhhr commented 6 years ago
  1. run without arguments:
    lua testxml.lua
    lua: testxml.lua:95: attempt to call a nil value (global 'read')
    stack traceback:
        testxml.lua:95: in main chunk
        [C]: in ?

    Need fix something like

    index = 1
    + if #arg == 0 then print(_usage); return end
  2. domHandler dont work
    lua testxml.lua -dom people.xml
    File    people.xml
    ----------- Dom
    lua: .\xmlhandler/dom.lua:110: attempt to index a nil value (field 'current')
    stack traceback:
        .\xmlhandler/dom.lua:110: in function 'xmlhandler/dom.decl'
        .\XmlParser.lua:205: in upvalue 'parseXmlDeclaration'
        .\XmlParser.lua:367: in upvalue 'parseTagType'
        .\XmlParser.lua:449: in function 'XmlParser.parse'
        testxml.lua:124: in main chunk
        [C]: in ?
manoelcampos commented 6 years ago

Thanks for reporting.

Issues fixed. However, the dom.lua handler is inherited from the original project and I haven't found a utility for it and it may be removed.