Every coldfusion tag that doesn't generate output (cfset, cfloop, cfif) is
going to be a blank line in your output file. I suppose if you need to
change it, you could surround those lines with

<cfsetting enableoutputonly="true">
<cfset something = "else">
<cfsetting enableoutputonly="false">

andy

-----Original Message-----
From: daniel kessler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 08, 2007 7:41 AM
To: CF-Talk
Subject: extra lines in rss

I have an rss feed and recently, while validating, I noticed that it has
alot of blank lines in it - about 40 per item.  I've not ben able able to
figure out why so far.  Any pointers would be great.  

Here's the code:

<cfquery name="retrieve_xml" datasource="dch">
        SELECT header,description,id,start_date FROM HH_CLNDR
        WHERE start_date >= sysdate
        ORDER BY start_date ASC
</cfquery>

<cfsavecontent variable="xml"><?xml version="1.0" ?> <rss version="2.0">

<channel>

<title>The School of Public Health - Calendar of Events (The University of
Maryland)</title> <description>This is the University of Maryland's School
of Public Health Calendar of Events.</description>
<link>http://sph.umd.edu</link> <cfoutput query="retrieve_xml">
        <!--- just clean for the xml, not for the db --->
        <cfset a_header = CleanChars(header)>
        <cfset a_desc = CleanChars(description)>
        <CF_RENoTags  input="#a_desc#"  variable="a_desc" >
        <CF_RENoTags  input="#a_header#"  variable="the_header" >
        <cfset a_desc = replace(a_desc,"&","and","all")>
        <cfset a_header = replace(a_header,"&","and","all")>
        
        <CFIF LEN(a_desc) gt desc_length>
                <CFSET desc = LEFT(a_desc,desc_length)>
                <cfset desc = ListDeleteAt(desc, ListLen(desc, " "), " ")>
<!--- deletes to the last full word --->
                <cfset desc = desc & "...">
        <cfelse> 
                <CFSET desc = description>
        </CFIF>         
        <cfset the_header = "#the_header#     DATE:
#dateformat(start_date,'long')#">       
<item>
<title>#the_header#</title>
<description>#desc#</description>
<link>http://sph.umd.edu/calendar_event.cfm?id=#id#</link>
<guid>http://sph.umd.edu/calendar_event.cfm?id=#id#</guid>
</item>
</cfoutput>
<cfoutput>
</channel>
</rss>
</cfoutput>
</cfsavecontent>

<cffile action="write" file="#CurrentDir#rss/calendar.xml" output="#xml#"
addnewline="no"> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292943
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to