AnsweredAssumed Answered

Creating RSS feed using Freemarker in Web Form

Question asked by samsteinig on Apr 4, 2011
Latest reply on Apr 4, 2011 by samsteinig
I'm trying to create an RSS feed using a web form.  For example, in one of our sites, we have a web form for blog entries.  The web form contains an ftl that lists links to all previous entries, which is what I'm trying to use to build an RSS xml file.  The resultant RSS xml file shows no entries.  I created an html (non-RSS) version of the ftl as a test, and it works fine.  Below is code for both the html and RSS versions of the ftl; hopefully I'm making a very basic mistake. 

FTL Code for RSS file (doesn't work; just a blank RSS page with no listed items, no errors):

<#ftl ns_prefixes={"D", ""}>
<?xml version="1.0" ?>
<rss version="2.0">
  <#assign docs = alf.parseXMLDocuments('sustain_blog_01', '/sustain/blog/2011')>
  <#list docs?sort_by("date")?reverse as x>

FTL Code for HTML test version (this DOES work):

<#ftl ns_prefixes={"D", ""}>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <#assign docs = alf.parseXMLDocuments('sustain_blog_01', '/sustain/blog/2011')>
  <#list docs?sort_by("date")?reverse as x>
    <a href="${x.file_name}.html">${x.file_name}.html</a><br>