Improve conformance by allowing 1.x as version#56
Conversation
|
CC @dbaron |
According to [1] an XML processor needs to accept documents with version strings matching the production: VersionNum::= '1.' [0-9]+ [1] https://www.w3.org/TR/REC-xml/#sec-prolog-dtd
|
The conformance test you've removed was correct. 1.0 spec recommends against using any other version despite the grammar definition, and 1.1 allows only 1.1 and nothing else. There hasn't been any other XML version in the last 20 years. https://www.w3.org/TR/xml11/#sec-prolog-dtd Additionally, this is a semver-major break, which makes it a costly change. |
|
The relevant part of XML 1.0 separates requirements for processors and requirements for documents. This text:
is a requirement for documents, not for processors. The normative text for processors is the grammar (which requires accepting any 1.x version), plus the note:
(This was a change in the Fifth Edition of XML 1.0, which was a revision whose goals were, I think, roughly, abandoning XML 1.1 and accomplishing its goals by changing XML 1.0.) |
I removed the failure expectation, not the test, right? The test is still running and is now passing because version 1.7 is now accepted, as the test expects. The tests description and expectation is: "a document with version=1.7, legal in XML 1.0 from 5th edition".
That's unfortunately true. And for fixing #55, for which I submitted #57, we would need another API modification - so my proposal would be to bundle these two changes before releasing a new major version. |
|
I'll make it parse, but for back-compat make it report as 1.0 (because that's the only version that allows >1.1) |
Improved DOCTYPE parsing, string conversion for XMLVersion and allowing documents with version 1.x. Covers Googler pull requests 54, 56, 57: kornelski/xml-rs#54 kornelski/xml-rs#56 kornelski/xml-rs#57 Changes merged in upstream but no version released yet. Covers $ git log 1.1.0.. bd8fe07 Allow parsing of XML Version 1.x to improve conformance 18c4d62 Move assert_match macro 30227e8 Nicer comparison for OwnedName f0e34b3 Thinner string type aba9a85 Backwards-compatible DOCTYPE properties 7da7012 Provide name, public and system id in Doctype event 34458a2 Add `as_str()` method to `XmlVersion` `enum`. Bug: 441911594 Change-Id: Icc58864e4393fe2725f9137f52cf92c23a5f3ba7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7172953 Auto-Submit: Dominik Röttsches <drott@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/main@{#1547919}
Improved DOCTYPE parsing, string conversion for XMLVersion and allowing documents with version 1.x. Covers Googler pull requests 54, 56, 57: kornelski/xml-rs#54 kornelski/xml-rs#56 kornelski/xml-rs#57 Changes merged in upstream but no version released yet. Covers $ git log 1.1.0.. bd8fe07 Allow parsing of XML Version 1.x to improve conformance 18c4d62 Move assert_match macro 30227e8 Nicer comparison for OwnedName f0e34b3 Thinner string type aba9a85 Backwards-compatible DOCTYPE properties 7da7012 Provide name, public and system id in Doctype event 34458a2 Add `as_str()` method to `XmlVersion` `enum`. Bug: 441911594 Change-Id: Icc58864e4393fe2725f9137f52cf92c23a5f3ba7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7172953 Auto-Submit: Dominik Röttsches <drott@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/main@{#1547919} NOKEYCHECK=True GitOrigin-RevId: e35fe768bc00fbe9e2c49e6f5334140eb8446b50
No description provided.