NaturalIntelligence / fast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
https://naturalintelligence.github.io/fast-xml-parser/
MIT License
2.49k stars 302 forks source link

Fail to reject multiple root nodes #542

Open bendrissou opened 1 year ago

bendrissou commented 1 year ago

The CLI command fxparser fails to reject multiple root nodes of type: self-closing tags.

It successfully rejects multiple root nodes, only when there is more than one "non-self-closing tags" elements at the root level.

I seems that the parser never considers self-closing tags as root nodes. Which is not in line with the XML specification.

For example, the following xml input is valid according to the parser: <vp></vp><TnqE/>

Running the following CLI command: fxparser -v example.xml

Produces output: { vp: '', TnqE: '' }

github-actions[bot] commented 1 year ago

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

amitguptagwl commented 1 year ago

Frankly speaking I didnt update CLI command with latest changes. It was completely forgotten. I'll update that and publish