You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2025/01/23 17:51:21 UTC
(maven-xinclude-extension) 01/01: demo bug
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch ns
in repository https://gitbox.apache.org/repos/asf/maven-xinclude-extension.git
commit 17f68d927466f428e3bcf86ca203ea5a2bc6e838
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Thu Jan 23 12:51:10 2025 -0500
demo bug
---
.../apache/maven/xinclude/stax/XIncludeTest.java | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/test/java/org/apache/maven/xinclude/stax/XIncludeTest.java b/src/test/java/org/apache/maven/xinclude/stax/XIncludeTest.java
index 1ce96c8..7c3f1c1 100644
--- a/src/test/java/org/apache/maven/xinclude/stax/XIncludeTest.java
+++ b/src/test/java/org/apache/maven/xinclude/stax/XIncludeTest.java
@@ -71,6 +71,31 @@ class XIncludeTest {
assertXInclude(input, includes, expected);
}
+ @Test
+ void testInclusionWithNamespaces() throws Exception {
+ String input = "<?xml version='1.0'?>\n" + "<document xmlns='http://example.org' xmlns:xi=\"http://www.w3.org/2001/XInclude\">\n"
+ + " <p>120 Mz is adequate for an average home user.</p>\n"
+ + " <xi:include href=\"disclaimer.xml\"/>\n"
+ + "</document>";
+ Map<String, String> includes = Collections.singletonMap(
+ "http://www.example.com/disclaimer.xml",
+ "<?xml version='1.0'?>\n" + "<disclaimer>\n"
+ + " <p>The opinions represented herein represent those of the individual\n"
+ + " and should not be interpreted as official policy endorsed by this\n"
+ + " organization.</p>\n"
+ + "</disclaimer>");
+ String expected = "<?xml version='1.0'?>\n" + "<document xmlns=\"http://example.org\" xmlns:xi=\"http://www.w3.org/2001/XInclude\">\n"
+ + " <p>120 Mz is adequate for an average home user.</p>\n"
+ + " <disclaimer xmlns=\"\" xml:base=\"http://www.example.com/disclaimer.xml\">\n"
+ + " <p>The opinions represented herein represent those of the individual\n"
+ + " and should not be interpreted as official policy endorsed by this\n"
+ + " organization.</p>\n"
+ + "</disclaimer>\n"
+ + "</document>";
+
+ assertXInclude(input, includes, expected);
+ }
+
@Test
void testTextualInclusion() throws Exception {
String input = "<?xml version='1.0'?>\n" + "<document xmlns:xi=\"http://www.w3.org/2001/XInclude\">\n"