Skip to content

Commit c90b6ea

Browse files
committed
URL Cleanup - upgrade to more modern Xalan namespace
See gh-22680
1 parent 83293b3 commit c90b6ea

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

spring-core/src/main/java/org/springframework/util/xml/TransformerUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ public static void enableIndenting(Transformer transformer, int indentAmount) {
6767
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
6868
try {
6969
// Xalan-specific, but this is the most common XSLT engine in any case
70-
transformer.setOutputProperty("{https://xml.apache.org/xslt}indent-amount", String.valueOf(indentAmount));
70+
transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", String.valueOf(indentAmount));
7171
}
7272
catch (IllegalArgumentException ignored) {
7373
}

spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,6 +30,8 @@
3030
import static org.junit.Assert.*;
3131

3232
/**
33+
* Unit tests for {@link TransformerUtils}.
34+
*
3335
* @author Rick Evans
3436
* @author Arjen Poutsma
3537
*/
@@ -42,7 +44,7 @@ public void enableIndentingSunnyDay() throws Exception {
4244
String indent = transformer.getOutputProperty(OutputKeys.INDENT);
4345
assertNotNull(indent);
4446
assertEquals("yes", indent);
45-
String indentAmount = transformer.getOutputProperty("{https://xml.apache.org/xslt}indent-amount");
47+
String indentAmount = transformer.getOutputProperty("{http://xml.apache.org/xalan}indent-amount");
4648
assertNotNull(indentAmount);
4749
assertEquals(String.valueOf(TransformerUtils.DEFAULT_INDENT_AMOUNT), indentAmount);
4850
}
@@ -55,7 +57,7 @@ public void enableIndentingSunnyDayWithCustomKosherIndentAmount() throws Excepti
5557
String indent = transformer.getOutputProperty(OutputKeys.INDENT);
5658
assertNotNull(indent);
5759
assertEquals("yes", indent);
58-
String indentAmount = transformer.getOutputProperty("{https://xml.apache.org/xslt}indent-amount");
60+
String indentAmount = transformer.getOutputProperty("{http://xml.apache.org/xalan}indent-amount");
5961
assertNotNull(indentAmount);
6062
assertEquals(indentAmountProperty, indentAmount);
6163
}

0 commit comments

Comments
 (0)