You might prefer the syntax provided by the XmlTool (in the VelocityTools project)
http://velocity.apache.org/tools/releases/2.0/javadoc/org/apache/velocity/tools/generic/XmlTool.html I much prefer it to Anakia and DVSL for simply navigating/reading xml files in a template. On Wed, Jan 25, 2012 at 6:19 AM, Angelo zerr <angelo.z...@gmail.com> wrote: > 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>${m.@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 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org