Show Table of Contents
5.3. FreeMarker Template Examples
- Inline template example:
<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"> <ftl:freemarker applyOnElement="order"> <ftl:template><!--<orderId>${order.id}</orderId>--></ftl:template> </ftl:freemarker> </smooks-resource-list> - FreeMarker external template example:
<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"> <ftl:freemarker applyOnElement="order"> <ftl:template>/templates/shop/ordergen.ftl</ftl:template> </ftl:freemarker> </smooks-resource-list> - Add the <use> element to the <ftl:freemarker> configuration in order to allow Smooks to perform a number of operations upon the resulting output. See the example below:
<ftl:freemarker applyOnElement="order"> <ftl:template>/templates/shop/ordergen.ftl</ftl:template> <ftl:use> <ftl:inline directive="insertbefore" /> </ftl:use> </ftl:freemarker>

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.