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

Relax tree:reduce to consider any node children other than those by #node #76

Closed rtyle closed 1 year ago

rtyle commented 2 years ago

xmlhandler.tree parsing of ...

<?xml version="1.0" encoding="utf-8" ?>
<device>
        T
        <manufacturer>M</manufacturer>
</device>

... will reduce the manufacturer_node to {manufacturer = 'M'}. When reducing the device_node, it will have two children ({[1] = 'T', manufacturer = 'M'}) but #device_node will only count one so it will be reduced into the parent_node ({device = 'T'}).

This pull request fixes this problem.

manoelcampos commented 1 year ago

I'm not being able to maintain this project and I'm looking for a maintainer that can take over it.

manoelcampos commented 1 year ago

Anyway, I don't think this is a valid XML. Are you getting it as a result from some software/service? Check #31.

manoelcampos commented 1 year ago

Closing due to lack of response.