keanu
keanu

Reputation: 123

Freemarker - Include Multiple templates inside config file

How can i include more than one template in Freemarker configuration file using Smooks?

<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">

<params>
  <param name="stream.filter.type">SAX</param>
  <param name="default.serialization.on">false</param>
</params>

<ftl:freemarker applyOnElement="Response">
  <ftl:template>template1.ftl</ftl:template>
  <ftl:template>template2.ftl</ftl:template>
</ftl:freemarker>

This doesnt seem to work. Throws an error at the second template line

Upvotes: 0

Views: 436

Answers (1)

Ori Marko
Ori Marko

Reputation: 58902

If you look at example you will see that each ftl:template tag should be inside ftl:freemarker tag. in your case:

<ftl:freemarker applyOnElement="Response">
  <ftl:template>template1.ftl</ftl:template>
</ftl:freemarker>
<ftl:freemarker applyOnElement="Response">
  <ftl:template>template2.ftl</ftl:template>
</ftl:freemarker>

Upvotes: 0

Related Questions