Question
Mozilla RSS error
Hi, I have 2 rss questions that I hope you can help me with
1.)I tried to use " http://www.adobe.com/cfusion/webforums/forum/rss.cfm", adobe's rss feed on http://www.feedvalidator.org but it does not validate, but why is it still used?
2.)the code (below) works in IE, but when I open rss.cfm in Firefox, I get error message: XML Parsing Error: xml declaration not at start of external entity Location: http://soohoo/crimestoppers/test/rss.cfm
Line Number 2, Column 1:" How can I fix this? Thanks so much -C
<!---My code...--->
<cfset NumberOfFeedItems = 10>
<!---
<cfquery name="getLatestPublishedArticles" datasource="yourDB">
SELECT TOP #numberOfFeedItems# *
FROM yourContent
ORDER BY PublishedDate DESC
</cfquery>
--->
<cfset theDatetime = "#dateformat(now(), "ddd, dd mmm yyyy")# #timeformat(now(), "HH:mm:ss")# PST">
<cfsetting enablecfoutputonly="yes">
<cfsavecontent variable="theXML">
<cfoutput>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- RSS generated by DevX on #theDatetime# -->
<rss version="2.0">
<channel>
<title>DevX Featured Content</title>
<link> http://www.devx.com</link>
<description>Latest DevX Content</description>
<language>en-us</language>
<copyright>Copyright 2002 DevX</copyright>
<docs> http://backend.userland.com/rss</docs>
<lastBuildDate>#theDatetime#</lastBuildDate>
<image>
<title>DevX</title>
<url> http://www.devx.com/assets/devx/3182.gif</url>
<link> http://www.DevX.com</link>
</image>
</cfoutput>
<cfloop from="1" to = "#numberOfFeedItems#" index="ctr">
<cfscript>
title = "titleXXX";
description = "titleXXX";
description = "titleXXX";
date = "titleXXX";
time = "titleXXX";
authors = "titleXXX";
pubDate = date & " " & time;
</cfscript>
<cfoutput>
<item>
<title>#title#</title>
<description>#description#</description>
<link> http://www.devx.com/content/id/</link>
<author>#authors#</author>
<pubDate>#pubDate#</pubDate>
</item>
</cfoutput>
</cfloop>
<cfoutput>
</channel>
</rss>
</cfoutput>
</cfsavecontent>
<cffile action="write" file="C:\Inetpub\wwwroot\Crimestoppers\test\rssXml.xml" output="#theXml#">
<cfcontent type="text/xml">
<cfoutput>#theXml#</cfoutput>
1.)I tried to use " http://www.adobe.com/cfusion/webforums/forum/rss.cfm", adobe's rss feed on http://www.feedvalidator.org but it does not validate, but why is it still used?
2.)the code (below) works in IE, but when I open rss.cfm in Firefox, I get error message: XML Parsing Error: xml declaration not at start of external entity Location: http://soohoo/crimestoppers/test/rss.cfm
Line Number 2, Column 1:" How can I fix this? Thanks so much -C
<!---My code...--->
<cfset NumberOfFeedItems = 10>
<!---
<cfquery name="getLatestPublishedArticles" datasource="yourDB">
SELECT TOP #numberOfFeedItems# *
FROM yourContent
ORDER BY PublishedDate DESC
</cfquery>
--->
<cfset theDatetime = "#dateformat(now(), "ddd, dd mmm yyyy")# #timeformat(now(), "HH:mm:ss")# PST">
<cfsetting enablecfoutputonly="yes">
<cfsavecontent variable="theXML">
<cfoutput>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- RSS generated by DevX on #theDatetime# -->
<rss version="2.0">
<channel>
<title>DevX Featured Content</title>
<link> http://www.devx.com</link>
<description>Latest DevX Content</description>
<language>en-us</language>
<copyright>Copyright 2002 DevX</copyright>
<docs> http://backend.userland.com/rss</docs>
<lastBuildDate>#theDatetime#</lastBuildDate>
<image>
<title>DevX</title>
<url> http://www.devx.com/assets/devx/3182.gif</url>
<link> http://www.DevX.com</link>
</image>
</cfoutput>
<cfloop from="1" to = "#numberOfFeedItems#" index="ctr">
<cfscript>
title = "titleXXX";
description = "titleXXX";
description = "titleXXX";
date = "titleXXX";
time = "titleXXX";
authors = "titleXXX";
pubDate = date & " " & time;
</cfscript>
<cfoutput>
<item>
<title>#title#</title>
<description>#description#</description>
<link> http://www.devx.com/content/id/</link>
<author>#authors#</author>
<pubDate>#pubDate#</pubDate>
</item>
</cfoutput>
</cfloop>
<cfoutput>
</channel>
</rss>
</cfoutput>
</cfsavecontent>
<cffile action="write" file="C:\Inetpub\wwwroot\Crimestoppers\test\rssXml.xml" output="#theXml#">
<cfcontent type="text/xml">
<cfoutput>#theXml#</cfoutput>