Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

xmlParse : Content is not allowed in prolog.

New Here ,
Oct 29, 2008 Oct 29, 2008
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.
TOPICS
Getting started
2.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 29, 2008 Oct 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2008 Oct 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)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 29, 2008 Oct 29, 2008
LATEST
ColdNovice wrote:
> Now it is giving "Connection Failure", I tried with few RSS feeds but it gives
> the same error.

Then I would say that is your problem. This code works perfectly on
*my* CF 8 developer server. I would suggest that for some reason your
server can not connect to these resources. Firewall? Proxy? Corporate
Policy?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources