-
Notifications
You must be signed in to change notification settings - Fork 0
/
smooks-config.xml
57 lines (50 loc) · 1.81 KB
/
smooks-config.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.3.xsd"
xmlns:g="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
<core:filterSettings type="SAX" />
<resource-config selector="shopping,categoryb">
<resource>org.milyn.delivery.DomModelCreator</resource>
</resource-config>
<g:groovy executeOnElement="type">
<g:script>
<!--
use(DOMCategory) {
// Modify "supplies": we need an extra 2 pens...
if (element.text() == 'supplies') {
element.item.each { item ->
if (item.name.text() == 'Pens') {
item.quantity = item.quantity.toInteger() + 2;
}
}
}
}
// When using the SAX filter, we need to explicitly write the fragment
// to the result stream...
writeFragment(element);
-->
</g:script>
</g:groovy>
<ftl:freemarker applyOnElement="shopping">
<ftl:template>
<!--<shoppingList>
<categories><?TEMPLATE-SPLIT-PI?></categories>
</shoppingList> -->
</ftl:template>
</ftl:freemarker>
<ftl:freemarker applyOnElement="categoryb">
<ftl:template>
<!--<type>${.vars["categoryb"].@type}</type>
<items>
<#list .vars["categoryb"].item as item>
<item>
<name>${item}</name>
<quantity>${item.@quantity[0]!"1"}</quantity>
<#if item.@when[0]??><date>${item.@when[0]}</date></#if>
</item>
</#list>
</items>-->
</ftl:template>
</ftl:freemarker>
</smooks-resource-list>