[XERCESJ-841] Update VersionNotSupported error message to include XML 1.1 - #117
[XERCESJ-841] Update VersionNotSupported error message to include XML 1.1#117elharo wants to merge 2 commits into
Conversation
[XERCESJ-841] The error message for unsupported XML versions now says 'only XML 1.0 and XML 1.1 are supported' instead of 'only XML 1.0 is supported'. Removed the now-redundant VersionNotSupported11 message key and getVersionNotSupportedKey() overrides in the XML 1.1 scanner subclasses.
There was a problem hiding this comment.
Pull request overview
This PR updates Xerces-J’s unsupported-XML-version error handling to reflect that the parser supports both XML 1.0 and XML 1.1, and removes now-redundant XML 1.1–specific message-key overrides.
Changes:
- Merged
VersionNotSupported/VersionNotSupported11into a singleVersionNotSupportedmessage that mentions both XML 1.0 and XML 1.1. - Removed
getVersionNotSupportedKey()overrides from the XML 1.1 document and DTD scanners so they use the base scanner’s key. - Eliminated the now-unused
VersionNotSupported11message key (and confirmed there are no remaining references in the repo).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/org/apache/xerces/impl/XML11DTDScannerImpl.java | Removes redundant getVersionNotSupportedKey() override now that the base key maps to the correct combined message. |
| src/org/apache/xerces/impl/XML11DocumentScannerImpl.java | Same: drops the XML 1.1–specific key override to rely on the base scanner behavior. |
| src/org/apache/xerces/impl/msg/XMLMessages.properties | Consolidates the version-not-supported message to mention both XML 1.0 and XML 1.1 and removes the separate XML 1.1 key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # 2.8 Prolog and Document Type Declaration | ||
| VersionInfoInvalid = Invalid version \"{0}\". | ||
| VersionNotSupported = XML version \"{0}\" is not supported, only XML 1.0 is supported. | ||
| VersionNotSupported11 = XML version \"{0}\" is not supported, only XML 1.0 and XML 1.1 are supported. |
There was a problem hiding this comment.
Is the bug really that we're using VersionNotSupported where we should be using VersionNotSupported11 or is it possible that in the configuration where the bug was found, only XML 1.0 was supported and that part of the bug is invalid?
The two separate messages are correct: - VersionNotSupported (XML 1.0 scanners): only XML 1.0 is supported - VersionNotSupported11 (XML 1.1 scanners): both XML 1.0 and 1.1 are supported Each scanner correctly reports what it supports.
|
Closing — the two separate message keys are correct. VersionNotSupported is used by XML 1.0 scanners (which only support 1.0), and VersionNotSupported11 is used by XML 1.1 scanners (which support both versions). Each is correct in its context. The System.out.println portion of XERCESJ-841 can be addressed in a separate PR if needed. |
Fixes the first part of XERCESJ-841.
The error message for unsupported XML versions now says "only XML 1.0 and XML 1.1 are supported" instead of "only XML 1.0 is supported", since Xerces supports both versions.
Changes:
XMLMessages.properties: mergedVersionNotSupportedandVersionNotSupported11into a single message that mentions both XML 1.0 and 1.1XML11DocumentScannerImpl.java: removedgetVersionNotSupportedKey()override (redundant — base class now returns the correct message)XML11DTDScannerImpl.java: sameThe System.out printing issue will be addressed in a follow-up PR.