Skip to content

fast-xml-parser 5.3.0 not parsing attributes #771

@PercentageCorporation

Description

@PercentageCorporation
  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?
  • Have you checked the docs for helpful APIs and examples?

Description

Online tool does not work either

Input

wow

Code

const testXML = `<root a="nice"><a>wow</a></root>`;
const options = {
      ignoreAttributes: false,
      attributeNamePrefix : "@_"
  };
const parser = new XMLParser();
var jsonData = parser.parse(testXML, options);

### Output
{
	"root": {
		"a": "wow"
	}
}
### expected data
{
	"root": {
		"@_a": "nice",
		"a": "wow"
	}
}
**Would you like to work on this issue?**
<!-- choose one by changing [ ] to [x] -->
- [ ] Yes
- [x ] No

[Bookmark](https://github.com/NaturalIntelligence/fast-xml-parser/stargazers) this repository for further updates. Visit [SoloThought](https://solothought.com) to know about recent features.

<!-- Love Fast-XML-Parser? Please consider supporting us:
👉   https://opencollective.com/fast-xml-parser/donate
👉   https://paypal.me/naturalintelligence 
👉👉  https://github.com/sponsors/NaturalIntelligence -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions