Quantcast
Channel: Library Web Chic » news-feeds
Viewing all articles
Browse latest Browse all 2

More Coldfusion and XML fun

$
0
0

I really wish that I had time to spend working on one project consistently. My XML project has been dragging as I work on a bunch of other job duties (most of them not related to coding). I was excited that Bruce has some suggestions about how to make my transformation for efficient. Unfortunately his suggestions didn’t come across so I’ll need to email him and ask if he can send me the code. Hopefully, he’ll let me post it here along with an explanation.

It is one things to know that you haven’t written something in the most efficient way but another to know the way to make it better. I knew my stylesheet wasn’t a streamlined as it could be. My XSLT skills are both rusty and limited. I never learned the kinds of things that Bruce was talking about in my XML class.

Here is the final piece of the Coldfusion puzzle. The code it takes to get a remote feed and then applies the transformation to it.

<cfset feedUrl = "http://www.somewebsite.com/xml/feed_you_want_to_parse.xml">
<cfhttp url="#feedUrl#" method="get" />
<cffile action="read" file="C:\path\to\transformation_file.xsl" variable="rssxsl">
<cfset Transformed = xmlTransform(cfhttp.FileContent, rssxsl)>
<cfoutput>
#Transformed#
</cfoutput>

Now that I have all the pieces to work with I can start on writing the module in a more cohesive way (ie. a custom Coldfusion tag, and a table in the database for the XML content type). Hopefully, I can make some significant progress on this project by the end of the week.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images