-
-
Notifications
You must be signed in to change notification settings - Fork 334
Closed
Description
If you try to validate an XML document that has a "length" attribute anywhere it fails with an error "attribute length is repeated". I've tracked this down to the use of an array here in the validator. The code that checks for repeated attributes checks if length is a property of the array. It appears that attrNames
can just be initialised as an object instead of an array to resolve this issue.
Checklist
- 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?
Input
<test length="1"></test>
Code
require('fast-xml-parser').validate('<test length="1"></test>');
Output
{ err: { code: 'InvalidAttr', msg: 'attribute length is repeated.' } }
expected data
true
Would you like to work on this issue?
- Yes
- No
Metadata
Metadata
Assignees
Labels
No labels