Skip to content

Commit c54e2e0

Browse files
committed
Fix #227: Add xml:base to macros element
The `macros` element needs support for xml:base in order to use it in xincluded files.
1 parent b4073cf commit c54e2e0

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/main/resources/schemata/metamorph.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<element ref="tns:macro" />
7272
<element ref="xi:include" />
7373
</choice>
74+
<attribute ref="xml:base" />
7475
</complexType>
7576
</element>
7677

src/test/java/org/culturegraph/mf/morph/MacroTest.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,21 @@
236236
</result>
237237
</test-case>
238238

239+
<test-case name="Issue 227: Should support xinclude for macros">
240+
<input type="text/x-formeta">
241+
1 { lit: in }
242+
</input>
243+
<transformation type="text/x-metamorph+xml">
244+
<mm:metamorph version="1">
245+
<include xmlns="http://www.w3.org/2001/XInclude" href="issue227-should-support-xinclude-for-macros.xml" />
246+
<mm:rules>
247+
<mm:call-macro name="test-macro" />
248+
</mm:rules>
249+
</mm:metamorph>
250+
</transformation>
251+
<result type="text/x-formeta">
252+
1 { lit: out }
253+
</result>
254+
</test-case>
255+
239256
</metamorph-test>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<macros xmlns="http://www.culturegraph.org/metamorph">
3+
<macro name="test-macro">
4+
<data source="lit">
5+
<constant value="out" />
6+
</data>
7+
</macro>
8+
</macros>

0 commit comments

Comments
 (0)