Jump to content

XML to RSS...


Mortekai

Recommended Posts

Ok, I am trying this, but I am not getting any results....

<rss version="2.0">

<channel>
  <title>W3Schools Home Page</title>
  <link>http://www.w3schools.com</link>
  <description>Free web building tutorials</description>
  

<?php
header('Content-type: text/html; charset=utf-8');
$xml = simplexml_load_file('filmer.xml');



foreach($xml->filmer->film as $film) {
echo"<item>";	
echo "<title>".utf8_decode($film->title)."</title>";
echo "<link>".utf8_decode($film->picture)."</link>";
echo "<description>".utf8_decode($film->title)."</description>";
echo"</item>";}



?>

</channel>
</rss>

Link to comment
https://forums.phpfreaks.com/topic/173249-xml-to-rss/#findComment-913239
Share on other sites

<?xml version="1.0" encoding="ISO-8859-1"?>
<filmer>
  <film>
    <title>Testfilm</title>
    <genre>Action</genre>
    <length>96</length>
    <rating>4</rating>
    <picture>http://static.lovefilm.se/img/cover/movie/small/Outlander/51284.jpg</picture>
    <year>2006</year>
  </film>
</filmer>

 

Need to be transformed to...

<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">

<channel>
  <title>Lämplig titel</title>
  <link>Länk</link>
  <description>Beskrivning</description>
  <item>
    <title>Testfilm</title>
    <link>http://www.w3schools.com/rss</link>
    <description>Action</description>
  </item>

</channel>

</rss>

Link to comment
https://forums.phpfreaks.com/topic/173249-xml-to-rss/#findComment-913280
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.