-
-
Notifications
You must be signed in to change notification settings - Fork 355
Closed
Labels
PendingPending to be confirmed by user/author for some check/update/implementationPending to be confirmed by user/author for some check/update/implementationgood first issue
Description
- Are you running the latest version?
"fast-xml-parser": "^4.0.9" - Have you included sample input, output, error, and expected output?
- Have you checked if you are using correct configuration?
- Did you try online tool?
It seems to be broken
Description
I'd like to use IsArray option, however, it seems to break on tags which have value 0 inside of them, such as 0 or 0.0. It is inconsistent with other numbers, interger or floats, that have non 0 value, as shown in my provided example.
Input
<root>
<a>0.00</a>
<b>0.01</b>
</root>
Code
const parser = new XMLParser({isArray: (name, jpath, isLeaf, isAttr) => !isLeaf});
let result = parser.parse(fr.result);
console.log(JSON.stringify(result, undefined, 2))
Output
{
"root": [
{
"a": [
0
],
"b": 0.01
}
]
}
expected data
{
"root": [
{
"a": 0,
"b": 0.01
}
]
}
Would you like to work on this issue?
- Yes
- No
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PendingPending to be confirmed by user/author for some check/update/implementationPending to be confirmed by user/author for some check/update/implementationgood first issue