You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you running the latest version? (5.11.2, master at cf66a9658004553bc740616e6c7a4912e7e9aab6)
Have you included sample input, output, error, and expected output?
Have you checked if you are using correct configuration? (default options)
Did you try online tool? (it reports Valid XML for the 22-byte sample)
Have you checked the docs for helpful APIs and examples?
Description
XMLValidator.validate accepts a comment containing -- before the closing delimiter. XML 1.0 comments cannot contain a double hyphen within the comment text. Python xml.etree.ElementTree rejects the same input as not well-formed at column 12.
I have a tested patch for this issue and am preparing a PR. It rejects invalid double hyphens in both validator comment-scanning paths, with coverage for comments before, inside and after the root. Prepared with Codex assistance, automated regression tests, and independent agent review.
I checked the separate fast-xml-validatorSyntaxValidator.validate on main at 335fcaf (package.json 1.4.2, Node 24.22.1). It returns true for the malformed <a><!--foo--bar--></a> and for the valid <a><!--ok--></a> control. This also reproduces in the separate validator.
Activity
Sskift commentedon Nov 2, 2026
I have a tested patch for this issue and am preparing a PR. It rejects invalid double hyphens in both validator comment-scanning paths, with coverage for comments before, inside and after the root. Prepared with Codex assistance, automated regression tests, and independent agent review.
amitguptagwl commentedon Nov 3, 2026
plz check fast-xml-validator once
agammann commentedon Nov 4, 2026
I checked the separate
fast-xml-validatorSyntaxValidator.validateon main at335fcaf(package.json1.4.2, Node 24.22.1). It returnstruefor the malformed<a><!--foo--bar--></a>and for the valid<a><!--ok--></a>control. This also reproduces in the separate validator.