提交 6dcc4148 编写于 作者: S Sam Brannen

URL Cleanup - upgrade to more modern Xalan namespace

See gh-22678
上级 1de492ae
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -67,7 +67,7 @@ public abstract class TransformerUtils { ...@@ -67,7 +67,7 @@ public abstract class TransformerUtils {
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.INDENT, "yes");
try { try {
// Xalan-specific, but this is the most common XSLT engine in any case // 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) { catch (IllegalArgumentException ignored) {
} }
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -30,6 +30,8 @@ import org.junit.Test; ...@@ -30,6 +30,8 @@ import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
/** /**
* Unit tests for {@link TransformerUtils}.
*
* @author Rick Evans * @author Rick Evans
* @author Arjen Poutsma * @author Arjen Poutsma
*/ */
...@@ -42,7 +44,7 @@ public class TransformerUtilsTests { ...@@ -42,7 +44,7 @@ public class TransformerUtilsTests {
String indent = transformer.getOutputProperty(OutputKeys.INDENT); String indent = transformer.getOutputProperty(OutputKeys.INDENT);
assertNotNull(indent); assertNotNull(indent);
assertEquals("yes", 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); assertNotNull(indentAmount);
assertEquals(String.valueOf(TransformerUtils.DEFAULT_INDENT_AMOUNT), indentAmount); assertEquals(String.valueOf(TransformerUtils.DEFAULT_INDENT_AMOUNT), indentAmount);
} }
...@@ -55,7 +57,7 @@ public class TransformerUtilsTests { ...@@ -55,7 +57,7 @@ public class TransformerUtilsTests {
String indent = transformer.getOutputProperty(OutputKeys.INDENT); String indent = transformer.getOutputProperty(OutputKeys.INDENT);
assertNotNull(indent); assertNotNull(indent);
assertEquals("yes", 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); assertNotNull(indentAmount);
assertEquals(indentAmountProperty, indentAmount); assertEquals(indentAmountProperty, indentAmount);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册