Skip to content

[XERCESJ-841] Update VersionNotSupported error message to include XML 1.1 - #117

Closed
elharo wants to merge 2 commits into
mainfrom
fix-versionnotsupported-message
Closed

[XERCESJ-841] Update VersionNotSupported error message to include XML 1.1#117
elharo wants to merge 2 commits into
mainfrom
fix-versionnotsupported-message

Conversation

@elharo

@elharo elharo commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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: merged VersionNotSupported and VersionNotSupported11 into a single message that mentions both XML 1.0 and 1.1
  • XML11DocumentScannerImpl.java: removed getVersionNotSupportedKey() override (redundant — base class now returns the correct message)
  • XML11DTDScannerImpl.java: same

The System.out printing issue will be addressed in a follow-up PR.

[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.
@elharo elharo changed the title Update VersionNotSupported error message to include XML 1.1 [XERCESJ-841] Update VersionNotSupported error message to include XML 1.1 Jul 19, 2026
@elharo
elharo requested a review from Copilot July 19, 2026 12:33
@elharo
elharo marked this pull request as draft July 19, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / VersionNotSupported11 into a single VersionNotSupported message 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 VersionNotSupported11 message 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@elharo

elharo commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

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.

@elharo elharo closed this Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants