From 4074155d76aa021455f54a2bc73376e7a7d5c6e1 Mon Sep 17 00:00:00 2001
From: Sam Brannen <104798+sbrannen@users.noreply.github.com>
Date: Thu, 25 Jun 2026 13:23:49 +0200
Subject: [PATCH] Polish contribution
See gh-36948
---
.../util/xml/XmlValidationModeDetectorTests.java | 6 ++++--
.../xml/dtdWithDoctypeInMultiLineCommentBody.xml | 8 ++++++++
...xsdWithMultipleDoctypesInMultiLineCommentBody.xml | 12 ++++++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 spring-core/src/test/resources/org/springframework/util/xml/dtdWithDoctypeInMultiLineCommentBody.xml
create mode 100644 spring-core/src/test/resources/org/springframework/util/xml/xsdWithMultipleDoctypesInMultiLineCommentBody.xml
diff --git a/spring-core/src/test/java/org/springframework/util/xml/XmlValidationModeDetectorTests.java b/spring-core/src/test/java/org/springframework/util/xml/XmlValidationModeDetectorTests.java
index dcdcf3e49d0..15a97691c1e 100644
--- a/spring-core/src/test/java/org/springframework/util/xml/XmlValidationModeDetectorTests.java
+++ b/spring-core/src/test/java/org/springframework/util/xml/XmlValidationModeDetectorTests.java
@@ -44,7 +44,8 @@ class XmlValidationModeDetectorTests {
"dtdWithTrailingComment.xml",
"dtdWithTrailingCommentAcrossMultipleLines.xml",
"dtdWithCommentOnNextLine.xml",
- "dtdWithMultipleComments.xml"
+ "dtdWithMultipleComments.xml",
+ "dtdWithDoctypeInMultiLineCommentBody.xml"
})
void dtdDetection(String fileName) throws Exception {
assertValidationMode(fileName, VALIDATION_DTD);
@@ -56,7 +57,8 @@ class XmlValidationModeDetectorTests {
"xsdWithMultipleComments.xml",
"xsdWithDoctypeInComment.xml",
"xsdWithDoctypeInOpenCommentWithAdditionalCommentOnSameLine.xml",
- "xsdWithDoctypeInMultiLineCommentBody.xml"
+ "xsdWithDoctypeInMultiLineCommentBody.xml",
+ "xsdWithMultipleDoctypesInMultiLineCommentBody.xml"
})
void xsdDetection(String fileName) throws Exception {
assertValidationMode(fileName, VALIDATION_XSD);
diff --git a/spring-core/src/test/resources/org/springframework/util/xml/dtdWithDoctypeInMultiLineCommentBody.xml b/spring-core/src/test/resources/org/springframework/util/xml/dtdWithDoctypeInMultiLineCommentBody.xml
new file mode 100644
index 00000000000..9256a3103b0
--- /dev/null
+++ b/spring-core/src/test/resources/org/springframework/util/xml/dtdWithDoctypeInMultiLineCommentBody.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/spring-core/src/test/resources/org/springframework/util/xml/xsdWithMultipleDoctypesInMultiLineCommentBody.xml b/spring-core/src/test/resources/org/springframework/util/xml/xsdWithMultipleDoctypesInMultiLineCommentBody.xml
new file mode 100644
index 00000000000..87a39cdaaf8
--- /dev/null
+++ b/spring-core/src/test/resources/org/springframework/util/xml/xsdWithMultipleDoctypesInMultiLineCommentBody.xml
@@ -0,0 +1,12 @@
+
+
+
+
+