Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transforming RSS feed

Status
Not open for further replies.

ilyawizard

Programmer
Feb 3, 2006
3
US
I have two questions here. I just started learning XML, which I'd say is really impressive. I might redo all of my sites in XML. But here's my issues:

1. I get an RSS feed from one of my suppliers. I was thinking about using XSL for displaing a feed box on my site, but not really sure yet if I can have this RSS feed stored on my server. Hence the question: is there a way to use XSL on the feed that is stored on the other server? I suspest no, and I know there are parsers that do that, but I don't want to get into this too deep.

2. Let's say I'm able to save xml file on my server. Here's a small example of the feed:

<item>
...
<link>test1.com</link>
<media:thumbnail url="test2.com" width="50" height="50" />
...
</item>

I know how to get the value of the link :
<xsl:value-of select="link"/>
But how do you get the url from media:thumbnale??? I have a book, but didn't find anything useful on this topic. Any help? Also if you know any good online sources on XML and XSL please share. Thanks a lot.
 
1. The normal way of doing it is for some code on your server to grab the xml feed, transform it with XSL, then display with (X)HTML. You can't store the feed on your server. The point of RSS feeds is they are constantly updated.

2. <xsl:value-of select="media:thumbnail"/> but be sure to add the namespace declaration to the <xsl:stylesheet> element, ie:

<xsl:stylesheet version="1.0" xmlns:xsl=" xmlns:media="some_namespace_specified_in_the_xml">


Is a good reference.

XML is best for structured data and communication between disparate systems. Normal database is much better to store data for websites.

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top