-
-
Notifications
You must be signed in to change notification settings - Fork 332
Open
Labels
PendingPending to be confirmed by user/author for some check/update/implementationPending to be confirmed by user/author for some check/update/implementation
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
Input
Try to validate this XML<note><?xml version="1.0" encoding="utf-8"?>test</note>
Code
XMLValidator.validate(`<note><?xml version="1.0" encoding="utf-8"?>test</note>`)
Output
XMLValidator returns true
expected data
XMLValidator.validate should return error with message XML declaration allowed only at the start of the document.
https://github.com/NaturalIntelligence/fast-xml-parser/blob/3c9e9fe4346a3c9924d4db45e60a7a29c565caac/src/validator.js#L206C46-L206C104
Additional Notes:
fast-xml-parser/src/validator.js
Line 204 in 3c9e9fe
const tagname = xmlData.substr(start, i - start); |
start = i
in our case and tagname
become ""
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
PendingPending to be confirmed by user/author for some check/update/implementationPending to be confirmed by user/author for some check/update/implementation