Apache FOP: Using user-defined functions?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache FOP: Using user-defined functions?

Nicolas Dubien
Dear Sir or Madam,

I am looking for an XLS-FO engine that can fit with my current
architecture. I am already using other engines which are based on
other technologies - not-XSL-FO. In our current architecture we are
using user-defined functions to add our proper features to the engine.

As a matter of fact, I was wondering if it is possible to integrate
user-defined functions in my XSL-FO templates and define them in Java.
Then your engine will call my Java function if necessary. I did not
find any solutions to do this on your website.

Here are examples of functions I would like to be able to call from
your engine during the generation:
 * getResourceUrl("my resource name")
 * ChangeCase($first_name_from_
xml, "Upper")
 * GetId($first_name_from_xml, $last_name_from_xml)

One of the engines I am using for the moment is FreeMarker, it has
this feature. It allows developers to wrap their own objects and send
them to their engine.
cf. http://freemarker.sourceforge.net/docs/api/freemarker/template/Template.html#process%28java.lang.Object,%20java.io.Writer,%20freemarker.template.ObjectWrapper%29

I am looking forward to hearing from you,
Nicolas DUBIEN

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Apache FOP: Using user-defined functions?

Alexios Giotis
Hi Nicolas,

FOP supports extensions [1] but it is better to implement the example functions you listed, before invoking FOP, during the generation of the XSL:FO. The XSL:FO can be generated using a template engine such as Freemarker but an engine that transforms XML to XSL:FO using XSLT stylesheets is a better fit. I suggest to use Apache Xalan (which is already used in FOP for convenience) and to write those functions as Xalan extensions [2].

Hope this helps,
Alex Giotis

[1] http://xmlgraphics.apache.org/fop/dev/extensions.html
[2] http://xml.apache.org/xalan-j/extensions.html



On 27 Jun 2013, at 13:02, Nicolas Dubien <[hidden email]> wrote:

> Dear Sir or Madam,
>
> I am looking for an XLS-FO engine that can fit with my current
> architecture. I am already using other engines which are based on
> other technologies - not-XSL-FO. In our current architecture we are
> using user-defined functions to add our proper features to the engine.
>
> As a matter of fact, I was wondering if it is possible to integrate
> user-defined functions in my XSL-FO templates and define them in Java.
> Then your engine will call my Java function if necessary. I did not
> find any solutions to do this on your website.
>
> Here are examples of functions I would like to be able to call from
> your engine during the generation:
> * getResourceUrl("my resource name")
> * ChangeCase($first_name_from_
> xml, "Upper")
> * GetId($first_name_from_xml, $last_name_from_xml)
>
> One of the engines I am using for the moment is FreeMarker, it has
> this feature. It allows developers to wrap their own objects and send
> them to their engine.
> cf. http://freemarker.sourceforge.net/docs/api/freemarker/template/Template.html#process%28java.lang.Object,%20java.io.Writer,%20freemarker.template.ObjectWrapper%29
>
> I am looking forward to hearing from you,
> Nicolas DUBIEN
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]