Open
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
When using the isArray
to specify which tags should be an array. If the tag is empty it produces an output with an array of a single empty string. [""]
instead of the expected []
.
Input
<root>
<EventList></EventList>
</root>
Code
new XMLParser({
ignoreAttributes: true,
isArray: (name) => {
return name.endsWith('List');
},
});
trimValues: true,
parseTagValue: true,
These don't seem to have any change on output in this scenario either.
Output
{
"EventList": [
""
],
}
expected data
{
"EventList": [],
}
Would you like to work on this issue?
- Yes
- No