Search code examples
rythm

Xml FIle generation using Rythm Template Engine


I am trying to generate an xml file using rythm template and wondering if there is a way to drop few tags based on business logic. Eg: Discard @error_message tag in case of a successful method execution.

Please help!.


Solution

  • Use @if directive:

    @ifNot(success) {
        @error_message()
    }