Skip to content

Conversation

naitoh
Copy link
Contributor

@naitoh naitoh commented Sep 9, 2025

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
@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
@kou kou changed the title Change REXML::Document.new("") to behave the same as REXML::Document.new(nil) Accept REXML::Document.new("") for backward compatibility 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
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thre are real world REXML::Document.new("") usages
2 participants