Solved

CF and XML

Posted on 2004-04-15
3
287 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
Comment Utility
<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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now