Duplicate ?xml when rendering the document
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
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.
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!
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 410
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from NaturalIntelligence/fast-xml-parser
-
A processing instruction with no target passes validation, then the builder prints invalid XMLPossibly taken @bardrop claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NaturalIntelligence/fast-xml-parser#927 · 2 comments ·
Maintainers usually reply within 4 days
-
XMLValidator accepts double hyphens inside commentsPossibly taken @Sskift claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NaturalIntelligence/fast-xml-parser#903 · 3 comments ·
Maintainers usually reply within 4 days
-
XMLValidator accepts raw < and & in attribute valuesPossibly taken @jeromeyyy claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NaturalIntelligence/fast-xml-parser#900 · 3 comments ·
Maintainers usually reply within 4 days
-
getMetaDataSymbol() declares a boxed SymbolPossibly taken @chiragbitoni claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 comment ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
NaturalIntelligence/fast-xml-parser#888 · 2 comments ·
Maintainers usually reply within 4 days
All issues in NaturalIntelligence/fast-xml-parser
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
Extended search drops any query term that contains a line breakPossibly taken @goranai claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day