-
-
Notifications
You must be signed in to change notification settings - Fork 329
Closed
Description
- 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?
Description
If an attribute is in a oneListGroup it isn't parsed as an attribute and simply disappear.
Input
const input = {
main: [
{ _attr: { ID: "" } },
{ sub: { _attr: { value: "" } } },
{ sub: { _attr: { value: "" } } }
]
};
Code
const builder = new XMLBuilder({
format: true,
attributesGroupName: '_attr',
attributeNamePrefix: '',
oneListGroup: true,
suppressEmptyNode: true,
suppressBooleanAttributes: false,
ignoreAttributes: false,
});
builder.build(input);
Output
<main>
<sub value=""/>
<sub value=""/>
</main>
expected data
<main ID="">
<sub value=""/>
<sub value=""/>
</main>
Would you like to work on this issue?
- Yes
- No
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
Metadata
Metadata
Assignees
Labels
No labels