alabianca / xml-to-json

Stream based XML to JSON converter
13 stars 9 forks source link

fix incorrect parsing of child elements with the same tag as the parent #11

Open recalcitrantQ opened 3 years ago

recalcitrantQ commented 3 years ago

The previous fix in findClosingIndex was failing to parse xml in the form

<a> <a> <a></a> </a> <a> <a></a> </a> </a>

due to only looking one level deep. This version will properly track the number of open tags that need to be accounted for instead of skipping to the last one available.

sailorca commented 3 years ago

Thank you for this. I bumped into this bug today and your patch resolved it.