>Perhaps add cfcontent before the output to set the right type for RSS?
I've been playing with this for the last few hours. Version 1, which uses
rss.cfc does this:
<cfcontent type="text/xml" reset="true">
<cfoutput>#rssxml#</cfoutput>
This works fine in almost everything, except IE9 (for me).
I see a blank page, although viewing the source looks correct.
Client sees (also in IE9), run-on unformatted text. Really odd.
Looking at the source, header looks like:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://purl.org/rss/1.0/"
>
I've gone ahead and written a test page using cffeed (CF8 version).
Same result - almost...
Still can't see it in IE9, works everywhere else, but another bug has cropped
up.
In the TITLE there's a single quote/apostrophe issue - regardless of what I do,
I end up with "Tom's Hardware". Nothing seems to fix that. However, in the
description (body), it displays correctly as "Tom's Harware". Go figure.
If I check the actual string before it goes into the cffeed tag, it's showing a
single quote "Tom's Hardware". Even stripping that out and replacing it with
' doesn't work. Still displays as "'" in the feed title.
Code for cleaning this stuff for both description and title looks like:
<cfset request.titlenohtml = "#rereplacenocase(pr.title,"<[^>]*>","","all")#"
/>
<cfset request.titlemsclean="#ReplaceMicrosoftChars(request.titlenohtml)#" />
<cfset request.titlemsclean = "#replace(request.titlemsclean, " ", " ",
"ALL")#">
<cfset request.titlemsclean = "#replace(request.titlemsclean, "–", "-",
"ALL")#">
<cfset request.titlemsclean = "#replace(request.titlemsclean, "&", "&",
"ALL")#">
<cfset myStruct.item[currentRow].title = "#xmlFormat(request.titlemsclean)#"
/>
Header for the feed, now using RSS 2.0 instead of 1.0, looks like:
<?xml version="1.0" encoding="UTF-8"?>
<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">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352169
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm