Solved

CF and XML

Posted on 2004-04-15
3
293 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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