-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation of invalid XML declarations #616
Comments
Can you please confirm if this is a valid issue? |
Sorry I missed your original message. FXP validator checks for syntax error only, any other issue like scheme related, or the one you're highlighted are not covered. |
I believe this is a syntax error. The expression does not conform to the XML syntax, or the XML grammar. So I assume this is unintended behaviour? |
Have you checked by disallowing boolean attributes? |
As shown above, I have enabled the |
Please try it from the code. I'm not sure if the CLI is updated with all the options. This docs can help you. const {XMLValidator} = require("fast-xml-parser");
const result = XMLValidator.validate(xmlData, {
allowBooleanAttributes: true
}); |
I have tried the code above:
Output is:
The XML input was accepted, despite having the unassigned attribute |
As I remember, The validator has no check for xml description tag. same with v5 |
Description
The parser accepts incorrect XML declarations as valid, without raising an error. This is despite enabling the validator option "-v".
Input
There is an unassigned attribute
var
, which I expected to raise an error. The input is saved in a file namedexample.xml
.Code
Output
My question is: Why the XML validator doesn't throw an error?
Please note that xmllint rejects the input example as invalid.
The text was updated successfully, but these errors were encountered: