Skip to main content
Participant
October 29, 2008
Question

xmlParse : Content is not allowed in prolog.

  • October 29, 2008
  • 1 reply
  • 2655 views
Can anyone let me know the issue with the code while executing on ColdFusion 8 developer edition.

<cfhttp url=" http://rss.news.yahoo.com/rss/tech/" method="get">
<cfset objRSS = xmlParse(Trim(cfhttp.filecontent))>
<CFDUMP var="#objRSS#">

It is giing me error: Content is not allowed in prolog.
This topic has been closed for replies.

1 reply

Inspiring
October 29, 2008
Your code worked just fine for me.

Put <cfoutput>#cfhttp.fileContent#</cfoutput> before the cfset line.

Yahoo often has throttles and limiters on their services like this. If
you exceed these thresholds you do not get the expected xml object but
instead you just get some type of error message.

Participant
October 29, 2008
<cfhttp url=" http://timesofindia.indiatimes.com/rssfeeds/1081479906.cms" method="get">
<cfoutput>#cfhttp.fileContent#</cfoutput>
<cfset objRSS = xmlParse(Trim(cfhttp.filecontent))>

Now it is giving "Connection Failure", I tried with few RSS feeds but it gives the same error.

coldfusion.xml.XmlProcessException: An error occured while Parsing an XML document.
at coldfusion.xml.XmlProcessor.parse(XmlProcessor.java:183)
at coldfusion.runtime.CFPage.XmlParse(CFPage.java:211)
at cftext2ecfm1120545296.runPage(D:\ColdFusion8\wwwroot\text.cfm:3)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)