473,461 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RSS Feeds to HTML using PHP

Rex
Hi,

I was trying to render a RSS feed using XSL.
http://www.mmmec.org/portal/rss/feed5.xsl
I used the following XSL file and was successfully able to render
static XML pages.
Click the following link:http://www.mmmec.org/portal/rss/test.xml
Probably this will help you out.

Now my problem arised when I tried to use PHP to do this for several
feed dynamically.
I used the same XML file. And I wrote a simple PHP code to fetch the
file and output it.
--------------------------------------------------------------------------------------------------------
<?php
$xml = file_get_contents("http://www.mmmec.org/portal/rss/test.xml");
echo $xml;
?>
--------------------------------------------------------------------------------------------------------
And when I give the URL of this php script, mozilla firefox fails to
display it
formatted.
Now, this seems just because the file extension was PHP or something
like that...
If I do a view-source for the XML file and the PHP file, they are
identical byte-by-byte.
Even IE is not displaying it properly.
Please guide.

Sometimes I feel that it is not even able to read the file XSL file
because there is no formatting at all!

May 4 '06 #1
2 1366
Rex wrote:
Hi,

I was trying to render a RSS feed using XSL.
http://www.mmmec.org/portal/rss/feed5.xsl
I used the following XSL file and was successfully able to render
static XML pages.
Click the following link:http://www.mmmec.org/portal/rss/test.xml
Probably this will help you out.

Now my problem arised when I tried to use PHP to do this for several
feed dynamically.
I used the same XML file. And I wrote a simple PHP code to fetch the
file and output it.
--------------------------------------------------------------------------------------------------------
<?php
$xml = file_get_contents("http://www.mmmec.org/portal/rss/test.xml");
echo $xml;
?>
--------------------------------------------------------------------------------------------------------
And when I give the URL of this php script, mozilla firefox fails to
display it
formatted.
Now, this seems just because the file extension was PHP or something
like that...
If I do a view-source for the XML file and the PHP file, they are
identical byte-by-byte.
Even IE is not displaying it properly.
Please guide.

Sometimes I feel that it is not even able to read the file XSL file
because there is no formatting at all!


One word, 'headers'. Two words, 'content-type'.

i.e. add before the echo:

header('Content-Type: text/xml');

HTH
Robin
May 4 '06 #2
Rex
Thanks Robin!
That was the only problem!!
It shows exactly as wanted in Firefox.
IE is still crazy. I guess it fails to handle XSL roperly...
I am satisfied with firefox.

thanks again..

May 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: plazma_41 | last post by:
Are there any uses for rss feeds on commercial websites selling products/services? Yes! I've just realized that eMaximarket Auctions ( http://www.emaximarket.com ) provides RSS feeds. For...
3
by: Eric Pratt | last post by:
http://msdn.microsoft.com/aboutmsdn/rss.asp All have been blank for 2 days now. Anyone have a clue?
3
by: Mike | last post by:
I want to create a ticker type app that consume RSS feeds from several sites, where can i find some informaton or code snippets now how to consume the RSS feeds and display the data?
0
by: Steve R. Hastings | last post by:
xe.py is a Python module to make it very easy to work with XML. I have attempted to make xe classes very Pythonic and intuitive. xe is intended for working with structured XML, such as...
2
by: dkode | last post by:
I built an asp.net usercontrol that consumes rss feeds that I specify the url for. Some of them (MVP blogs, google news) consumes the feeds just fine. and other times (75%) it chokes on...
1
by: nostradamus | last post by:
Hi! We need to integrate an RSS feed in a webpage using ASP. I've been testing out the great script at ByteScout: http://bytescout.com/how_to_display_rss_using_asp.html It worked very...
5
by: Shawn | last post by:
Hi, I want to understand and follow RSS feed because many web pages provide RSS feed for updated new data(e.g. http://www.weather.gov/rss/). But I never get how to use it. The link below suppose...
4
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 with Apache 2.2. I'm looking for recommendations on free code I can use to generate RSS feeds. I found FeedCreator though Google, but that is terrible. It cannot...
1
by: beaker | last post by:
Access Database-driven ASP page with embedded RSS feeds Hi, I know very little about web development in general - just some basic html scripting, CSS and a bit of XML. I've inherited a public...
1
by: ojsimon | last post by:
Hi I Am using Simplepie to display some rss feeds, currently it displays them in date and time order but i want it to display them in relevance order by using a usort function. here is the code...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.