View Full Version : Template Frameworks

02-20-2008, 11:34 PM

I'm searching for a template framework where it's possible to transform a POJO into an XML-file. The creation of the templates has to be as easy as possible (GUI-based would be perfect, so non-programmers can also create the templates).

For the xml-file, it has to be possible to define your own tags within the template. So for example you can say the xml has to look like:


With the Info being a value of a variable from my POJO.
I already tried JasperReports because this should have this possibility. But JasperReports will automatically generate the tags itself. (As far as I understand the program)

Can somebody advise me on wich platform would be able to do these things?
Or maybe it's possible to do it with JasperReports but I looked over it?

If my question isn't clear enough, just say so and I'll try to clarify it some more :thumbsup:

Thx, Sven

02-20-2008, 11:38 PM
take a look at xstream (http://xstream.codehaus.org/) pretty nifty and easy enough to setup

02-21-2008, 06:29 AM
Thx, this looks very promising. :)

02-21-2008, 10:43 AM
Just took another look at XStream, but it isn't what I'm looking for because it hasn't got the template functionalities.

It will print an object to xml and give the tags the name of the class or the variable name. Instead I want to be able to define those names in the template, and only set the element nodes to a value of my POJO.

So the final .xml should for example contain the following:

<col1 justify="right" width="4">Aant</col1>
<col2 allowoverflow="true" truncate="true" justify="left" width="22">Omschrijving</col2>
<col3 allownewline="true" justify="right" width="7">Prijs</col3>
<col4 justify="right" width="10">Waarde</col4>
<col5 justify="right" width="3" />

All the attributes names en tag names should be defined in the template (because these aren't variables of the POJO), the element node values and attribute node values are static text within the template or come from a POJO.