AnsweredAssumed Answered

Processing a freemarker template from Javascript API

Question asked by randomman on Oct 9, 2007
Latest reply on Oct 17, 2007 by kevinr
Hi. As part of a content rule I'm executing a script. As part of that script i'd like to run a bit of freemarker to extract part of an xhtml document.

For example:
var strFreemarker = "<#assign dom=document.xmlNodeModel />${dom.html}";   
var strContent = document.processTemplate(strFreemarker);

I'd like to be able to stick in some xpath stuff so I can extract the elements i want. However, my simple test above isn't working. I get the following error:
document.xmlNodeModel is undefined.
Anyone got any pointers on this?

This is an improvement on yesterday when processTemplate failed completely. It turned out that was due to a bug. I'm now running the community 2.2 nightly build to sort that out.