|
Posted by Robin on 05/04/06 11:19
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
[Back to original message]
|