Transform RSS-Feed into another "standard" XML-Format with PHP

Posted by ChrisBenyamin on Stack Overflow See other posts from Stack Overflow or by ChrisBenyamin
Published on 2010-06-16T20:39:20Z Indexed on 2010/06/16 20:42 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
|

Hey friends,

quick question: I need to transform a default RSS Structure into another XML-format.

The RSS File is like....

Name des RSS Feed Feed Beschreibung de http://xml-rss.de Sat, 1 Jan 2000 00:00:00 GMT Titel der Nachricht Die Nachricht an sich http://xml-rss.de/link-zur-nachricht.htm Sat, 1. Jan 2000 00:00:00 GMT 01012000-000000 Titel der Nachricht Die Nachricht an sich http://xml-rss.de/link-zur-nachricht.htm Sat, 1. Jan 2000 00:00:00 GMT 01012000-000000 Titel der Nachricht Die Nachricht an sich http://xml-rss.de/link-zur-nachricht.htm Sat, 1. Jan 2000 00:00:00 GMT 01012000-000000

...and I want to extract only the item-elements (with childs and attributes) XML like:

<?xml version="1.0" encoding="ISO-8859-1"?>
<item>
    <title>Titel der Nachricht</title>
    <description>Die Nachricht an sich</description>
   <link>http://xml-rss.de/link-zur-nachricht.htm</link>
   <pubDate>Sat, 1. Jan 2000 00:00:00 GMT</pubDate>
   <guid>01012000-000000</guid>
</item>
...

It hasn't to be stored into a file. I need just the output.

I tried different approaches with DOMNode, SimpleXML, XPath, ... but without success.

Thanks chris

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml