Sorry for the off topic conversation but I can't resist :)

> On the other hand, I'm not sure it has support for XPath selectors in the
FreeMarker declarative XML processing, which is usually the best approach
for more complex XML structures.

Freemarker supports XPath selectors... see here
http://freemarker.sourceforge.net/docs/xgui_imperative_learn.html#autoid_72

> Maybe that's the case, as the technology used to generate PDF is FO,
which is XML-based, but then I'm talking about something I barely know

FO is a markup language used to generate PDF's. It's just an XML document
and is comparable to HTML.

I have been involved in a project which changed from XSLT/FO transformation
to a Freemarker/FO transformation to generate PDFs. We drastically reduced
the template file sizes and were also able to implement things that were
very difficult with XSLT. For instance, it would be very easy to implement
some tynamo security tags to control which elements should be visible in a
PDF. You can also easily lookup your localised messages etc etc.

---------- Forwarded message ----------
From: Thiago H. de Paula Figueiredo
Date: Tuesday, 20 March 2012
Subject: Make Report PDF
To: Tapestry users <users@tapestry.apache.org>, Lance Java <
lance.j...@googlemail.com>


On Tue, 20 Mar 2012 09:28:39 -0300, Lance Java <lance.j...@googlemail.com>
wrote:

>> Actually, XSLT makes sense when the source document is XML already.
>
> I disagree, both freemarker and XSLT need to parse the XML input into
some form of DOM object before applying a transformation to it. Do you agree
> that XSLT templates are far more verbose than Freemarker templates?

No. :) I've just quickly checked the FreeMarker documention about XML
processing. My impression is that if you have a simpler XML structure and
output, FreeMarker is a better choice. On the other hand, I'm not sure it
has support for XPath selectors in the FreeMarker declarative XML
processing, which is usually the best approach for more complex XML
structures.

>> Sorry, Lance, my flame war detector failed to detect it in this thread.
>
> Sorry for the inconvenience. :P
>
> I'm not trying to start a flame war here.

I haven't seen any here too, but I just wanted to continue the joke. :)

> It just seems that people blindly
> often choose XSLT for XML transformations without considering freemarker.

Agreed. The more options known, the better the choice.

> In this thread, trsvax mentions using JAXB to convert java objects to XML
> so that they can be passed to XSLT which parses them into DOM objects.
Why not just pass the java objects to freemarker and avoid XML all together?

I thought the Java to XML part was strange too, unless the declarative way
is better for the described scenario. Maybe that's the case, as the
technology used to generate PDF is FO, which is XML-based, but then I'm
talking about something I barely know . . .

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

Reply via email to