I have an xml from an RSS-feed like the following example (random data) :
[text]
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://test_url/test/Feed/test.svc/"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/0 ... s/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">Title1</title>
<entry>
<id>http://Product1.com</id>
<title type="text">Product1</title>
<contributor>
<uri>http://www.product1/product1.pdf</uri>
</contributor>
<content type="application/xml">
<m:properties>
<d:ProductName>Product1</d:ProductName>
<d:DescriptionNL>Productbeschrijving1</d:DescriptionNL>
</m:properties>
</content>
</entry>
<entry>
<id>http://Product2.com</id>
<title type="text">Product2</title>
<contributor>
<uri>http://www.product2/product2.pdf</uri>
</contributor>
<content type="application/xml">
<m:properties>
<d:ProductName>Product2</d:ProductName>
<d:DescriptionNL>Productbeschrijving2</d:DescriptionNL>
</m:properties>
</content>
</entry>
</feed>
[/text]
I already have following PHP-code :
Code: Select all
<?php
$url = "http:\\feed_url";
$str = file_get_contents($url);
$xml = simplexml_load_string($str);
echo $xml->title;
foreach ($xml->entry as $item) {
echo "<h2> <a href=" . $item->contributor->uri . ">" . $item->title . "</a> </h2>";
}
?>
However, I am not able to get these data out of the XML-data.
Can anyone help with this problem ?
Grtz,