Open afbpinheiro opened 11 months ago
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.
It is difficult to decide sometimes what behavior should be kept as different user has different needs. And introducing so many options to control the formatting also can confuse users to take right decision. But I'll check what best can be done
@amitguptagwl thanks for your response.
I would say, based on the docs definition (https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/3.XMLBuilder.md#format): "By default, parsed XML is single line XML string. By format: true, you can format it for better view", the current output is not correct/expected.
Honestly speaking <root></root>
is my favourite. Just think it as a json property, we don't put comma (value ending indicator) in another line. So probably, I've done it for my own preference, I don't remember. But I'll check what I can do to. Probably, custom formatting themes can be introduced, I'll keep mine, you keep your own. And library will support standard by default.
Description
After upgrading from 3.17.4 to 4.2.7 there was an unexpected change in how XMLBuilder behaved regarding putting line breaks in empty elements.
Input
Code
Output
expected data