cancel
Showing results for 
Search instead for 
Did you mean: 

passing xml in web scripts

randomman
Champ in-the-making
Champ in-the-making
Is it possible to pass a chunk of xml from Javascript to the Freemarker Template instead of an array? Or should I be looking at doing this kind of functionality in a Java-backed web script?
3 REPLIES 3

davidc
Star Contributor
Star Contributor
Alfresco Freemarker supports processing of XML residing in an Alfresco document node.  So, if your XML is already in a document in the repository, it's simple.

http://wiki.alfresco.com/wiki/Template_Guide#XML_Content_Processing_Model_API

If your XML is coming from elsewhere, you might be able to create a transient document node in the javascript (and set the content to the XML string) for it to be used in freemarker.

Otherwise, use a Java-backed Web Script.

Web Script support for XML will become stronger in the future as we look to support specs such as ATOM/APP.

sgartner
Champ on-the-rise
Champ on-the-rise
If your XML is coming from elsewhere, you might be able to create a transient document node in the javascript (and set the content to the XML string) for it to be used in freemarker.

Anyone know what a "transient document node" is and how to create one?

invictus9
Champ in-the-making
Champ in-the-making
If your XML is coming from elsewhere, you might be able to create a transient document node in the javascript (and set the content to the XML string) for it to be used in freemarker.

Anyone know what a "transient document node" is and how to create one?

I believe that this means to create a temporary file, write the XML contents to it, and then pass it on.