Re: [FreeMarker-user] freemarker xml/xslt functions
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
|
From: Russell S. <rus...@ho...> - 2005-12-21 21:25:46
|
Daniel,
Thanks for getting back to me.
>At the first glance it appears to me that Jaxen has a problem, not
>FreeMarker. (You should use Jaxen 1.1 if you don't... lot of things was
>fixed there.)
I grabbed jaxen-1.1-beta-5 and dom4j-1.6.1 and still get errors:
[freemarker] org.jaxen.FunctionCallException: Failed to parse document for
URI:file:///c:/java/projects/acms/src/front-end/home.xml
[freemarker] The problematic instruction:
[freemarker] ----------
[freemarker] ==> assignment:
loaded=.node['document("file:///c:/java/projects/acms/src/front-end/home.xml")']
[on line 43, column 1 in faq2html.ftl]
[freemarker] ----------
[freemarker] Java backtrace for programmers:
[freemarker] ----------
[freemarker] freemarker.template.TemplateModelException:
org.jaxen.FunctionCallException: Failed to parse document for URI:
file:///c:/java/projects/acms/src/front-end/home.xml
[freemarker] at
freemarker.ext.dom.JaxenXPathSupport.executeQuery(JaxenXPathSupport.java:120)
[freemarker] at freemarker.ext.dom.NodeModel.get(NodeModel.java:279)
[freemarker] at
freemarker.ext.dom.DocumentModel.get(DocumentModel.java:93)
[freemarker] at
freemarker.core.DynamicKeyName.dealWithStringKey(DynamicKeyName.java:136)
[freemarker] at
freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKey
>
> > How best to accomplish this?
>
>This is rather just matter of taste, but I prefer to load XML-s with FTL
>methods (functions). Like, if you look at FMPP, it has a generic
>pp.loadData(...) method that can load data from various data source,
>including XML-s. So it doesn't depend on XPath, also it can have various
>wrapping related parameters.
>
If I read the docs correctly, I have to create a class that has the method
loadData() and then register that method and later call that method, is that
correct? I'm new to FreeMarker, but come from Velocity, so I'm not sure
about this. Are you refering to this:
http://www.freemarker.org/docs/pgui_datamodel_method.html
I will dl FMPP and see what's available there.
>OK, I have fixed in the CVS. Except that I have omitted ${basedir}.
>That's the default anyway, right?
yes, your build.xml set basedir="."
|