Solved

CF and XML

Posted on 2004-04-15
3
294 Views
Last Modified: 2013-12-24
What are the tags in CF that allow processing of XML documents?
0
Comment
Question by:jl1
3 Comments
 
LVL 9

Accepted Solution

by:
CFDevHead earned 50 total points
ID: 10836635
<cfscript>
  URLToPull  = "http://www.somesite.com/rss/";
</cfscript>



<cfhttp url="#URLToPull#"
           method="GET"
           timeout="15">
</cfhttp>


<cfscript>
  XMLContent = trim(cfhttp.filecontent);
  XMLContent = XMLParse(XMLContent);
</cfscript>


<cfoutput>
    Feed provided by:<br>
    <a href="#XMLContent.rss.channel.image.link.xmlText#">
       <img src="#XMLContent.rss.channel.image.url.xmlText#" alt="#XMLContent.rss.channel.image.title.xmlText#" border="0">
    </a><br>
    #XMLContent.rss.channel.title.xmlText#<br>
    #XMLContent.rss.channel.description.xmlText#<br><br>
</cfoutput>


<cfloop from="1" to="#ArrayLen(XMLContent.rss.channel.item)#" index="idx">
 <hr>
 <cfoutput>
 <cfdump var="#XMLContent.rss.channel.item[idx]#"><!---
 <a href="#XMLContent.rss.channel.item[idx].link.xmlText#">#XMLContent.rss.channel.item[idx].title.xmlText#</a><br>
 #XMLContent.rss.channel.item[idx].description.xmlText#
 #ParagraphFormat(ReplaceNoCase(XMLContent.rss.channel.item[idx].description.xmlText, "&lt;", "<", "ALL"))#
Author: #XMLContent.rss.channel.item[idx].date.xmlText#<BR>
Author: #XMLContent.rss.channel.item[idx].date.xmlText#<BR>  --->

 </cfoutput>
</cfloop>



hope this helps


0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question