<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Freemarker Template Process XML Document in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-template-process-xml-document/m-p/240651#M193781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After studying other posts and a lot of google and alfresco wiki I have made a little bit of progress. Instead of using processTemplate I have made my getContent.get.html.ftl the template and prefixed all my variables with xml_doc. I have also edited my content.get.js to pass the xml content node to the template:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;getContent.get.js&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var node = avm.lookupNode(args['from']);&lt;BR /&gt;var result = node;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;getContent.get.html.ftl&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;#assign xml_doc=node.xmlNodeModel&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;My only problem now is alf.parseXMLDocument doesn't work. Do i need to add something to the ns_prefixes or is there a certain way to load the alf. commands?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;07270352 Wrapped Exception (with status template): 07270351 Error during processing of the template 'Expression alf is undefined on line 3, column 16 in schema/getContent.get.html.ftl.'. Please contact your system administrator.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2009 08:51:00 GMT</pubDate>
    <dc:creator>parrym</dc:creator>
    <dc:date>2009-08-27T08:51:00Z</dc:date>
    <item>
      <title>Freemarker Template Process XML Document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-template-process-xml-document/m-p/240650#M193780</link>
      <description>I am having trouble processing an XML document with a Freemarker template within a Web Script. I have given a stripped down example below:getContent.get.jsvar doc1 = userhome.createFile("transform_me4.txt");doc1.mimetype = "text/xml";doc1.content = "&amp;lt;category&amp;gt;&amp;lt;article&amp;gt;see me&amp;lt;/article&amp;amp;</description>
      <pubDate>Wed, 26 Aug 2009 15:25:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-template-process-xml-document/m-p/240650#M193780</guid>
      <dc:creator>parrym</dc:creator>
      <dc:date>2009-08-26T15:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Freemarker Template Process XML Document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-template-process-xml-document/m-p/240651#M193781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After studying other posts and a lot of google and alfresco wiki I have made a little bit of progress. Instead of using processTemplate I have made my getContent.get.html.ftl the template and prefixed all my variables with xml_doc. I have also edited my content.get.js to pass the xml content node to the template:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;getContent.get.js&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var node = avm.lookupNode(args['from']);&lt;BR /&gt;var result = node;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;getContent.get.html.ftl&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;#assign xml_doc=node.xmlNodeModel&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;My only problem now is alf.parseXMLDocument doesn't work. Do i need to add something to the ns_prefixes or is there a certain way to load the alf. commands?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;07270352 Wrapped Exception (with status template): 07270351 Error during processing of the template 'Expression alf is undefined on line 3, column 16 in schema/getContent.get.html.ftl.'. Please contact your system administrator.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 08:51:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-template-process-xml-document/m-p/240651#M193781</guid>
      <dc:creator>parrym</dc:creator>
      <dc:date>2009-08-27T08:51:00Z</dc:date>
    </item>
  </channel>
</rss>

