fast-xml-parser
fast-xml-parser copied to clipboard
unable to use the value "true" in an attribute
Checklist
- [ ] Have you asked your question on Stackoverflow or similar forum?
- [X ] Are you running the latest version?
- [ X] Have you included sample input, output, error, and expected output?
- [X ] Have you checked if you are using correct configuration?
- [ X] Did you try online tool?
Input object:
{
"iteration": {
"@_test": "true",
}
}
Code
``
const { XMLBuilder } = require('fast-xml-parser');
builder = new XMLBuilder({ ignoreAttributes: false, format: true, suppressEmptyNode: true });
builder.build({
"iteration": {
"@_test": "true",
}
})
### Output
<?xml version="1.0"?>
<iteration test></iteration>
### expected data
<?xml version="1.0"?>
<iteration test="true"></iteration>
**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.
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.
this is good html, but not good xml. throwing into an xml linter or internet explorer bombs out, expecting the attribute to equal something
A name contained an invalid character. Error processing resource 'file:/X
Have you tried 'suppressBooleanAttributes:false' ?
closing as no response. Please reopen if issue still exist