Cluain / Lua-Simple-XML-Parser

Read simple XML easily
153 stars 91 forks source link

it don't work if xml string contain 'type' attribute #12

Open longshaoye180 opened 7 years ago

longshaoye180 commented 7 years ago

here is the code: local xml = require("xmlSimple").newParser() local xmlbody = [[<body><message type='chat' read_type='1' from='gambo' to='gambo' ></message></body>]] local xmlTab = xml:ParseXmlText(xmlbody) print(xmlTab.body.message['@type']) print(xmlTab.body.message['@from']) print(xmlTab.body.message['@to']) print(xmlTab.body.message['@read_type']) the result is: table: 0xa462f0 gambo gambo nil