NaturalIntelligence / NaturalIntelligence/fast-xml-parser
Duplicate ?xml when rendering the document
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 395
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 1
Description
Hi!
I'm testing it now using this page: https://naturalintelligence.github.io/fast-xml-parser/
I noticed that if I provide XML like this:
<?xml version="1.0" encoding="utf-8"?>
<test></test>
it generates me the JSON like this:
{
"?xml": {
"@_version": "1.0",
"@_encoding": "utf-8"
},
"test": ""
}
now when I render XML again I have ?xml node described twice:
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<test></test>
and if I parse such XML of course it fails.
Could you please check why? Is it a bug of the library or just the UI issue? Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction on the fast-xml-parser demo page and use the XML and JSON examples in the report to trace the parse-then-render flow. Verify whether the XML declaration is added both from configuration and from the parsed "?xml" node. Done means rendering the reported input produces one declaration and the result can be parsed again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100