Skip to content

Commit 928f8b6

Browse files
milanmajchrakclaude
andcommitted
Register the xml prefix so @xml:lang assertions compile
XmlMatcherBuilder builds its NamespaceContext from a plain map with no built-in prefixes, so JAXP cannot resolve the reserved "xml" prefix and ccmmXmlLangFollowsTheXoaiLanguageWrapper failed with "Prefix must resolve to a namespace: xml". Register it alongside ccmm. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 93618c2 commit 928f8b6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
public class CcmmXslTest extends AbstractXSLTest {
3131

3232
private static final String CCMM_NS = "https://schema.ccmm.cz/research-data/1.1";
33+
private static final String XML_NS = "http://www.w3.org/XML/1998/namespace";
3334
private static final String MAIN = "xoai-ccmm-test.xml";
3435
private static final String MINIMAL = "xoai-ccmm-minimal-test.xml";
3536
private static final String APPROX = "xoai-ccmm-approximate-date-test.xml";
@@ -753,7 +754,10 @@ public void ccmmAlwaysEmitsAtLeastOneIdentifier() throws Exception {
753754
}
754755

755756
private XmlMatcherBuilder ccmm() {
757+
// XmlMatcherBuilder's NamespaceContext is a plain map, so the reserved "xml" prefix has
758+
// to be registered explicitly or JAXP cannot compile an @xml:lang step.
756759
return xml()
757-
.withNamespace("ccmm", CCMM_NS);
760+
.withNamespace("ccmm", CCMM_NS)
761+
.withNamespace("xml", XML_NS);
758762
}
759763
}

0 commit comments

Comments
 (0)