xml2lua icon indicating copy to clipboard operation
xml2lua copied to clipboard

clearing results to be able to parse multiple xml files?

Open ownlyme opened this issue 1 year ago • 1 comments

when i parse multiple xml files, the additional files seem to get added to the same table and there doesn't seem to be a way to clear the results

ownlyme avatar Nov 14 '23 19:11 ownlyme

i have the same issue. how do i clear it before i can pass another xml string?

tuananh avatar Dec 06 '23 12:12 tuananh

the trick is

handler = handler:new()

edit example3.lua, add these lines at end to see the example:

print("\nUsing New handler instance")
handler = handler:new()
parser = xml2lua.parser(handler)
parser:parse(xml)
xml2lua.printable(handler.root)

nilzao avatar May 01 '24 17:05 nilzao