Easy way to verify the template

35 views
Skip to first unread message

Shervin

unread,
Sep 15, 2011, 4:53:12 AM9/15/11
to jodreports-users
Hi.

Is there an easy way to verify if the template is correctly formated
withouth running through createDocument() ?
Basically, I want to read the xml, see if it is well formed (as
freemarker is concurned)?

Or is it if you use the Ctrl - F2 that you always get well formed
values?

Ansgar Konermann

unread,
Sep 15, 2011, 3:37:47 PM9/15/11
to jodrepor...@googlegroups.com
Am 15.09.2011 10:53, schrieb Shervin:
Hi.

Is there an easy way to verify if the template is correctly formated
withouth running through createDocument() ?
Basically, I want to read the xml, see if it is well formed (as
freemarker is concurned)?

None I'm aware of. We're doing a lot of unit tests which consist of feeding example data into the template using createDocument() and see if the resulting document can still be read using Simple Java API for ODF [1]. We also have a few test support classes which might be a candidate to release as OSS. This way, we catch all the problems that might occurr due to FTL templates creating ill-formed XML.

One of my colleague is currently pushing the Jetbrains guys to fix IDEA's 'IntelliLang' feature, so that it will be possible to have some form of syntax checking inside the content.xml contained in your ODF document from inside IDEA. Build 108.944 of IDEA has this fix in (but is not released yet AFAICS). This would however mean you'd have to find some way to extract the content.xml file from your ODF template file and re-pack it if you want to use it as a template. IIRC, JODReports can also work with unpacked directories as templates, but you'd be on your own to make this work in your IDE for the time being.

Hope this helps a bit.

Ansgar

[1] http://odftoolkit.org/projects/simple/pages/Home


Or is it if you use the Ctrl - F2 that you always get well formed
values?

What does CTRL-F2 do? Which tool are you using this shortcut in?



Reply all
Reply to author
Forward
0 new messages