Click to See Complete Forum and Search --> : How to display rss news feeds?


NiVRaM
02-12-2005, 10:45 AM
Hello,

I'm sorry if this is such a vague and unlearned question, but I don't understand rss feeds at all. I am trying to display the rss feed located HERE (http://www.leesmovieinfo.net/outsource/xmldaily.php?chart_id=2068) on my website, looking similar to THIS (http://www.moovees.com/bo-daily.php).

I've searched around the net and have been unable to come across any well written tutorials or guides that help me. Could someone explain how to display remote rss news feeds here, or link me to a guide? From what I have gathered, I need to use xslt to convert it to readable html, but I'm not exactly sure how to do that. If someone could show me a basic template to follow, that would be great.

Thanks in advance, and I'm sorry for the stupid question,
-NiV

Khalid Ali
02-13-2005, 12:22 AM
Its a good question and here is the link (http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html) that can help you begin understanding the concepts.
Ince you learn the What and Where's of RSS then its only matter of choice to decide about a programming language that u want to use to parse RSS feeds.
Take a look at the resouce and then let me know what other questions u may have.

NiVRaM
02-13-2005, 01:09 AM
Heh I think I briefly browsed that article before. I was looking over a few of the other posts and found some tutorial links very easy and helpful.

So far, I created an XSLT file, which looks like this (I included comments for my reference using //, wasn't sure how to comment in xslt)...
//XML Headers
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

// How to Process CHANNEL
<xsl:template match="channel">

//Begin Table and Headers
<html>
<head>
<title>Lee's Movie Info</title>
</head>
<table>
<tr>
<td>Rank</td>
<td>Title</td>
<td>Daily</td>
<td>Theatres</td>
<td>Average</td>
<td>Total</td>
</tr>

// Process ITEM
<xsl:apply-templates select="item"/>
</table>
</html>
</xsl:template>

// How to Process ITEM
<xsl:template match="item">
<tr>
<td><xsl:value-of select="rank"/></td>
<td><a href="<xsl:value-of select="link"/>"><xsl:value-of select="title"/></a></td>
<td><xsl:value-of select="daily"/></td>
<td><xsl:value-of select="theaters"/></td>
<td><xsl:value-of select="average"/></td>
<td><xsl:value-of select="total"/></td>
</tr>
</xsl:template>

//End XML
</xsl:stylesheet>


I believe that is correct so far, but I'm not positive. Now however, I don't know exactly where to go from here. Am I supposed to upload that file as a something.xslt to my webserver? How do I link it so that it takes the information from the RSS file HERE (http://www.leesmovieinfo.net/outsource/xmldaily.php?chart_id=2068) ? And how do I get it to create a readable .html file, do I need some transformer program? If so, where do I get it and how do I install it to my webserver?

Sorry for all the questions, but I feel that I've made a lot of progress and the hard stuff is out of the way. Time to figure out what to do with my work thus far.

Thanks,
-NiV

Khalid Ali
02-13-2005, 02:54 AM
the logic will work like this
1. XML/RSS resource.
2. XSL/XSLT file
3. Output (html in your case).

There are at least multiple options that I can think of e.g
1. Using a XSL/XSLT processor (go to jakarta.apache.org for this)
How this will work that you pass it to an xml source+xslt file and
pick the out put type.
2. Right a little program in any language of choice(I know using java
makes this whole process piece of cake), get xml file, apply xslt and
return the out put to the broser.

LiLcRaZyFuZzY
02-13-2005, 05:05 AM
and xslt is written as xml, isnt it?
so their comment is like <!-- Comment --> html comments

NiVRaM
02-13-2005, 05:20 PM
Originally posted by Khalid Ali
the logic will work like this
1. XML/RSS resource.
2. XSL/XSLT file
3. Output (html in your case).

There are at least multiple options that I can think of e.g
1. Using a XSL/XSLT processor (go to jakarta.apache.org for this)
How this will work that you pass it to an xml source+xslt file and
pick the out put type.
2. Right a little program in any language of choice(I know using java
makes this whole process piece of cake), get xml file, apply xslt and
return the out put to the broser.

Alright. Well the java sounds like a better choice, are there prewritten java scripts that I should just download and use, or do I have to custom make/adapt one myself (if so, how)?

In addition, I would *prefer* to embed the produced html file into an already written html file. This would save me the trouble of using an iframe. If there is a specific approach for that, then lets go that route...

Thanks

LiLcRaZyFuZzY
02-14-2005, 10:08 AM
maybe this can be of some use
http://java.sun.com/xml/tutorial_intro.html

NiVRaM
02-18-2005, 10:51 PM
Bump for help.

I've got the XSL file nearly sorted out. Check it out HERE (http://www.renegadeforces.com/nivram/test.xsl). Its having trouble with the a href link, but beyond that its fine.

I'm at a loss where to go from here. Once again, the XML/RSS file I'm using is a remote file found HERE (http://www.leesmovieinfo.net/outsource/xmldaily.php?chart_id=2068) .

What do I need to do to generate HTML now? When I go to my XSL file, it just shows it like an ordinary XML file. I assume I need to add some link to the XML reference file to it, how do I do that?


By the way, it would be great if someone could contact me via AIM (FaSTBaLL1459) or MSN (marvinslayer@hotmail.com), so I could get this done faster. Thanks in advance,

-NiVRaM

Khalid Ali
02-19-2005, 02:19 AM
go to the following link it shall show you both how to handle/create links and how to import a xsl file in your XML file.once you have that taken care of then just open up your xml file in browser just like any other html file and when the page is loaded the built in XSL processor will display the contents as desired according to the XSL file
here is the link (http://www.webapplikations.com/pages/html_js/xmlstuff/cdcatalogNS.xml)

NiVRaM
02-19-2005, 01:15 PM
Originally posted by Khalid Ali
go to the following link it shall show you both how to handle/create links and how to import a xsl file in your XML file.once you have that taken care of then just open up your xml file in browser just like any other html file and when the page is loaded the built in XSL processor will display the contents as desired according to the XSL file
here is the link (http://www.webapplikations.com/pages/html_js/xmlstuff/cdcatalogNS.xml)

I'm a bit confused here. It seems like all I need to do is add the appropriate header to the xml file, but the xml file I'm trying to use is a remote file. Its located at http://www.leesmovieinfo.net/outsource/xmldaily.php?chart_id=2068 and I have no way of modifying it. I need my XSL file to pull data from that uneditable remote XML file.

Khalid Ali
02-19-2005, 10:42 PM
I am not aware of the fact that if this is possible, however I know that you can import XML files in XSL file, you will need to read the specs on it. will it work in your situation or not thats a diff story.
A safe and sure shot will be to use Java or some other programming language that allows to apply a style to XML file.