cfloop and cfoutput creates carriage return in RSS Feed
Ronsweb Jun 10, 2010 12:21 PMI am having problems with validation of a RSS Feed that I am creating using CFXML. I have tried both cfoutput and cfloop and is creating the following:
<item>
<title>Events: career panel on Career Options with a Library Technician Certificate</title>
<link>http://events.lbcc.edu/detail.cfm?eventid=1286</link>
<description>The Library Department & LAC Career & Job Services Center will host a career panel on Career Options with a Library Technician Certificate. 11:00 a.m. to 1:00 p.m. in Building E - Student Center. </description>
</item>
<---------------------- cfloop and cfoutput is Adding carriage return creating a non valid rss feed.
<item>
<title>Events: EOPS applications will be available beginning May 3</title>
<link>http://events.lbcc.edu/detail.cfm?eventid=1273</link>
<description>Due to increased FAFSA application volume in Financial Aid, EOPS applications will be available beginning May 3.For further questions please call 562-938-4772 (LAC) or 562-938-3097 (PCC).</description>
</item>
If I use cffeed the xml is working correctly as follows and creates a valid feed:
<item>
<title>Events: career panel on Career Options with a Library Technician Certificate</title>
<link>http://events.lbcc.edu/detail.cfm?eventid=1286</link>
<description>The Library Department & LAC Career & Job Services Center will host a career panel on Career Options with a Library Technician Certificate. 11:00 a.m. to 1:00 p.m. in Building E - Student Center. </description>
</item>
<item>
<title>Events: EOPS applications will be available beginning May 3</title>
<link>http://events.lbcc.edu/detail.cfm?eventid=1273</link>
<description>Due to increased FAFSA application volume in Financial Aid, EOPS applications will be available beginning May 3.For further questions please call 562-938-4772 (LAC) or 562-938-3097 (PCC).</description>
</item>
Here is my code:
<cfcomponent output="false">
<cffunction name="UpdateRSSFeed" access="remote" returntype="void">
<cfset RSSXMLPath = "e:\websites\www\RSSFeed\">
<!--- Create All News and Events Feed--->
<cfinvoke component="eventsystem" method="listAllNewsEvents" returnvariable="listAllNewsEventsRET">
<cfoutput>
<cfxml variable="AllNewsEventsFeed">
<rss xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns##" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
<channel>
<title>News and Events RSS Feed</title>
<link>http://www.lbcc.edu/</link>
<cfloop query="listAllNewsEventsRET">
<item>
<title><cfif listAllNewsEventsRET.event_typeID eq 2>News:<cfelse>Events:</cfif> #XMLFormat(listAllNewsEventsRET.Event_Title)#</title>
<link>#listAllNewsEventsRET.FullLink#</link>
<description>#XMLFormat(listAllNewsEventsRET.summary)#</description>
</item>
</cfloop>
</channel>
</rss>
</cfxml>
</cfoutput>
<!--- Write to file --->
<cffile
action="write"
addnewline="no" charset="us-ascii"
file="#RSSXMLPath#NewsEvents2.xml"
output="#ToString(AllNewsEventsFeed)#" fixnewline="no">
</cffunction>
</cfcomponent>
Any suggestions would be appreciated.
Thanks.
Ron

