Description
Steps to reproduce:
- go to the online tool https://naturalintelligence.github.io/fast-xml-parser/
- no additional input needed, just click "Parse to JSON"
- then "Parse to XML"
- and again "Parse to JSON"
- it'll print
Error: XML declaration allowed only at the start of the document.:2:6
I guess this is due to the { "?xml": "", ... } property, which converts to an invalid and duplicated doctype, resulting in an invalid XML:
<?xml version="1.0"?>
<?xml?>
<!-- ... the rest of the XML is valid -->
If i uncheck the "Ignore attributes" checkbox, then at the 2nd step i'll get a JSON that starts with this
{
"?xml": {
"@_version": "1.0"
},
and when you convert it back to XML then you get a valid, but still duplicated doctype, which results in the same error:
<?xml version="1.0"?>
<?xml version="1.0"?>
<!-- ... the rest of the XML is valid -->
Code
The default XML sample that's in the online tool.
Output
expected data
Would you like to work on this issue?
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
Description
Steps to reproduce:
Error: XML declaration allowed only at the start of the document.:2:6I guess this is due to the
{ "?xml": "", ... }property, which converts to an invalid and duplicated doctype, resulting in an invalid XML:If i uncheck the "Ignore attributes" checkbox, then at the 2nd step i'll get a JSON that starts with this
{ "?xml": { "@_version": "1.0" },and when you convert it back to XML then you get a valid, but still duplicated doctype, which results in the same error:
Code
The default XML sample that's in the online tool.
Output
expected data
Would you like to work on this issue?
Bookmark this repository for further updates. Visit SoloThought to know about recent features.