Menu

Freemarker - Generate two different XML output with one function

Help
2017-05-17
2017-05-17
  • Emmanuel Donsimoni

    Hi,

    I am fairly new to Freemarker and to template engine in general.
    Basicly I want to be able to generate at least two XML files (from two templates) with the same Java "main class".
    For exemple:
    - myTemplate1.ftl contain : <res>${res}</res><Administration creationTime="${creationTime}">
    and
    - myTemplate2.ftl contain : <Administration creationTime="${creationTime}"><resutlt>${result}</result>
    How can I write one class "Main" to process this without being specific (I do not want to write line per line, because then it would be pointless to create an engine)

    Can you please help me understand how it work through an example if possible ?

    Regards

     

Log in to post a comment.