mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Merge branch '7.0.x'
This commit is contained in:
+3
-1
@@ -151,7 +151,9 @@ public class XmlValidationModeDetector {
|
||||
private String consumeCommentTokens(String line) {
|
||||
int indexOfStartComment = line.indexOf(START_COMMENT);
|
||||
if (indexOfStartComment == -1 && !line.contains(END_COMMENT)) {
|
||||
return line;
|
||||
// If we are inside a multi-line comment, the entire line is comment
|
||||
// data and must not be treated as content.
|
||||
return (this.inComment ? "" : line);
|
||||
}
|
||||
|
||||
String result = "";
|
||||
|
||||
+5
-2
@@ -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);
|
||||
@@ -55,7 +56,9 @@ class XmlValidationModeDetectorTests {
|
||||
"xsdWithNoComments.xml",
|
||||
"xsdWithMultipleComments.xml",
|
||||
"xsdWithDoctypeInComment.xml",
|
||||
"xsdWithDoctypeInOpenCommentWithAdditionalCommentOnSameLine.xml"
|
||||
"xsdWithDoctypeInOpenCommentWithAdditionalCommentOnSameLine.xml",
|
||||
"xsdWithDoctypeInMultiLineCommentBody.xml",
|
||||
"xsdWithMultipleDoctypesInMultiLineCommentBody.xml"
|
||||
})
|
||||
void xsdDetection(String fileName) throws Exception {
|
||||
assertValidationMode(fileName, VALIDATION_XSD);
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
DOCTYPE
|
||||
-->
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "https://www.springframework.org/dtd/spring-beans-2.0.dtd">
|
||||
<beans>
|
||||
|
||||
</beans>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
See the DOCTYPE notes for legacy configs
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
</beans>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
xxx DOCTYPE xxx
|
||||
yyy
|
||||
zzz DOCTYPE zzz
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user