Skip to content

Accept REXML::Document.new("") for backward compatibility#295

Merged
kou merged 2 commits into
ruby:masterfrom
naitoh:update_compatibility
Sep 10, 2025
Merged

Accept REXML::Document.new("") for backward compatibility#295
kou merged 2 commits into
ruby:masterfrom
naitoh:update_compatibility

Conversation

@naitoh

@naitoh naitoh commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Why?

GitHub: Fix GH-296

XML without a root element is invalid XML, but to maintain backward compatibility,
we will change the behavior of REXML::Document.new("") to be the same as REXML::Document.new(nil).

Reported by Joe Rafaniello. Thanks!!!

@naitoh naitoh requested a review from kou September 9, 2025 23:35
Comment thread test/test_core.rb Outdated
Comment thread lib/rexml/document.rb
@naitoh naitoh force-pushed the update_compatibility branch from a41f3cc to 248f0de Compare September 10, 2025 00:04
@naitoh naitoh requested a review from kou September 10, 2025 00:10
Comment thread test/test_core.rb Outdated
Comment thread test/test_core.rb Outdated
@kou kou changed the title Change REXML::Document.new("") to behave the same as REXML::Document.new(nil) Sep 10, 2025
…nt.new(nil)`

## Why?
XML without a root element is invalid XML, but to maintain compatibility,
we will change the behavior of `REXML::Document.new("")` to be the same as `REXML::Document.new(nil)`.
@naitoh naitoh force-pushed the update_compatibility branch from 248f0de to fd9f75a Compare September 10, 2025 01:13
@naitoh naitoh requested a review from kou September 10, 2025 01:17
Comment thread lib/rexml/document.rb Outdated
@kou kou merged commit 37cde3f into ruby:master Sep 10, 2025
67 checks passed
@naitoh naitoh deleted the update_compatibility branch September 10, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants