Angelo zerr
2012-01-25 14:19:24 UTC
Hi Velocity Team,
I'm one of developer of XDocReport <http://code.google.com/p/xdocreport/>which
is Java reporting API to generate docx, odt, pptx etc from a docx, odt,
pptx by using Velocity and Freemarker syntax to set the fields to replace,
manage loop etc...
Goal of XDocReport is to create reporting with MS Word or OpenOffice and
use Velocity/Freemarker interpolation and directive. So the report is very
simply to create.
Velocity integration with XDocReport works great and very performant (I had
implemented my own Velocity cache).
I would like use XML DOM as Java context (insteaod of Java POJO context).
When I serach XML+Velocity in google I find :
* DVSL : http://velocity.apache.org/dvsl/releases/dvsl-1.0/users-guide.html
* Anakia : http://velocity.apache.org/engine/devel/anakia.html
As I have said, goal of XDocReport is to simplify the reporting creation
and if I want to use XML as Java context with Velocity It seems I must use
Anakia and I find it's not very easy to write the fields (more there is a
new dependency to JDOM).
You must write that with Velocity Anakia :
------------------------------------------------------------------------------------------------------
#set ($customMenus = $xpath.applyTo("body/menu",$customContext))
#foreach($customMenu in $customMenus)
<strong>$customMenu.getAttributeValue("name")</strong>
#end
------------------------------------------------------------------------------------------------------
With Freemarker I find it's more easy :
------------------------------------------------------------------------------------------------------
[#list doc.body.menu as m]
<strong>${***@name}</strong>
[/#list]
------------------------------------------------------------------------------------------------------
So I would like know if it's possible to do that with Velocity, if I can
implement my own DOM-Wrapper to manage this syntax.
Thank a lot for your help.
Regards Angelo
I'm one of developer of XDocReport <http://code.google.com/p/xdocreport/>which
is Java reporting API to generate docx, odt, pptx etc from a docx, odt,
pptx by using Velocity and Freemarker syntax to set the fields to replace,
manage loop etc...
Goal of XDocReport is to create reporting with MS Word or OpenOffice and
use Velocity/Freemarker interpolation and directive. So the report is very
simply to create.
Velocity integration with XDocReport works great and very performant (I had
implemented my own Velocity cache).
I would like use XML DOM as Java context (insteaod of Java POJO context).
When I serach XML+Velocity in google I find :
* DVSL : http://velocity.apache.org/dvsl/releases/dvsl-1.0/users-guide.html
* Anakia : http://velocity.apache.org/engine/devel/anakia.html
As I have said, goal of XDocReport is to simplify the reporting creation
and if I want to use XML as Java context with Velocity It seems I must use
Anakia and I find it's not very easy to write the fields (more there is a
new dependency to JDOM).
You must write that with Velocity Anakia :
------------------------------------------------------------------------------------------------------
#set ($customMenus = $xpath.applyTo("body/menu",$customContext))
#foreach($customMenu in $customMenus)
<strong>$customMenu.getAttributeValue("name")</strong>
#end
------------------------------------------------------------------------------------------------------
With Freemarker I find it's more easy :
------------------------------------------------------------------------------------------------------
[#list doc.body.menu as m]
<strong>${***@name}</strong>
[/#list]
------------------------------------------------------------------------------------------------------
So I would like know if it's possible to do that with Velocity, if I can
implement my own DOM-Wrapper to manage this syntax.
Thank a lot for your help.
Regards Angelo