File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed
main/java/org/culturegraph/mf/morph
test/java/org/culturegraph/mf/morph Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ private void handleRule(final Node node) {
312
312
throw new MorphDefException ("Macro '" + macroName + "' undefined!" );
313
313
}
314
314
vars = new ScopedHashMap <String , String >(vars );
315
- vars .putAll (attributeMap (node ));
315
+ vars .putAll (resolvedAttributeMap (node ));
316
316
handleRules (macroNode );
317
317
vars = vars .getOuterScope ();
318
318
}else {
Original file line number Diff line number Diff line change 187
187
</result >
188
188
</test-case >
189
189
190
+ <test-case name =" nested macros with variables being passed through" >
191
+ <input type =" text/x-cg+xml" >
192
+ <cgxml : cgxml version =" 1.0" >
193
+ <cgxml : records >
194
+ <cgxml : record id =" 1" >
195
+ <cgxml : literal name =" country" value =" Hawaii" />
196
+ </cgxml : record >
197
+ </cgxml : records >
198
+ </cgxml : cgxml >
199
+ </input >
200
+
201
+ <transformation type =" text/x-metamorph+xml" >
202
+ <mm : metamorph version =" 1" entityMarker =" ." >
203
+ <mm : macros >
204
+ <mm : macro name =" prepend" >
205
+ <mm : data source =" country" >
206
+ <mm : compose prefix =" $[with]" />
207
+ </mm : data >
208
+ </mm : macro >
209
+
210
+ <mm : macro name =" wrapInEntity" >
211
+ <mm : entity name =" entity" >
212
+ <mm : call-macro name =" prepend" with =" $[prefix]" />
213
+ </mm : entity >
214
+ </mm : macro >
215
+ </mm : macros >
216
+ <mm : rules >
217
+ <mm : call-macro name =" wrapInEntity" prefix =" 1: " />
218
+ <mm : call-macro name =" wrapInEntity" prefix =" 2: " />
219
+ </mm : rules >
220
+ </mm : metamorph >
221
+ </transformation >
222
+
223
+ <result type =" text/x-cg+xml" >
224
+ <cgxml : cgxml version =" 1.0" >
225
+ <cgxml : records >
226
+ <cgxml : record id =" 1" >
227
+ <cgxml : entity name =" entity" >
228
+ <cgxml : literal name =" country" value =" 1: Hawaii" />
229
+ </cgxml : entity >
230
+ <cgxml : entity name =" entity" >
231
+ <cgxml : literal name =" country" value =" 2: Hawaii" />
232
+ </cgxml : entity >
233
+ </cgxml : record >
234
+ </cgxml : records >
235
+ </cgxml : cgxml >
236
+ </result >
237
+ </test-case >
238
+
190
239
</metamorph-test >
You can’t perform that action at this time.
0 commit comments