From 6dcc414805e4da54ef1506e1be3cf47a817b125c Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 27 Mar 2019 16:49:10 +0100 Subject: [PATCH] URL Cleanup - upgrade to more modern Xalan namespace See gh-22678 --- .../org/springframework/util/xml/TransformerUtils.java | 4 ++-- .../springframework/util/xml/TransformerUtilsTests.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/xml/TransformerUtils.java b/spring-core/src/main/java/org/springframework/util/xml/TransformerUtils.java index 498e1c2bff..e6f6cd3d59 100644 --- a/spring-core/src/main/java/org/springframework/util/xml/TransformerUtils.java +++ b/spring-core/src/main/java/org/springframework/util/xml/TransformerUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ public abstract class TransformerUtils { transformer.setOutputProperty(OutputKeys.INDENT, "yes"); try { // Xalan-specific, but this is the most common XSLT engine in any case - transformer.setOutputProperty("{https://xml.apache.org/xslt}indent-amount", String.valueOf(indentAmount)); + transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", String.valueOf(indentAmount)); } catch (IllegalArgumentException ignored) { } diff --git a/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java b/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java index 4fe5e1f6e7..0634334ca8 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,8 @@ import org.junit.Test; import static org.junit.Assert.*; /** + * Unit tests for {@link TransformerUtils}. + * * @author Rick Evans * @author Arjen Poutsma */ @@ -42,7 +44,7 @@ public class TransformerUtilsTests { String indent = transformer.getOutputProperty(OutputKeys.INDENT); assertNotNull(indent); assertEquals("yes", indent); - String indentAmount = transformer.getOutputProperty("{https://xml.apache.org/xslt}indent-amount"); + String indentAmount = transformer.getOutputProperty("{http://xml.apache.org/xalan}indent-amount"); assertNotNull(indentAmount); assertEquals(String.valueOf(TransformerUtils.DEFAULT_INDENT_AMOUNT), indentAmount); } @@ -55,7 +57,7 @@ public class TransformerUtilsTests { String indent = transformer.getOutputProperty(OutputKeys.INDENT); assertNotNull(indent); assertEquals("yes", indent); - String indentAmount = transformer.getOutputProperty("{https://xml.apache.org/xslt}indent-amount"); + String indentAmount = transformer.getOutputProperty("{http://xml.apache.org/xalan}indent-amount"); assertNotNull(indentAmount); assertEquals(indentAmountProperty, indentAmount); } -- GitLab