problem using SimpleXML

hello,! i’m begining with simpleXML
here is my xml file (GEORSS)

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:geo="" xmlns:georss="" xmlns:gml="" xmlns:mappoint="">
        <title>Zones etudes KSpot</title>
        <description>Localisation des zones d'etudes disponible dans KSPOT adi pour Kyris mai 2007</description>
        <description>0;Croix:3;Marc en Baroeul:2,5;Orvault;</description>
        <geo:lat> 50.5388373881578</geo:lat>
        <geo:long> 2.80992893502116</geo:long>
        <description>0;Croix:15,5;Marc en Baroeul:0;Orvault;</description>
        <geo:lat> 50.0355881731957</geo:lat>
        <geo:long> 3.14659385941923</geo:long>
        <description>0;Croix:4;Marc en Baroeul:3,5;Orvault;</description>
        <geo:lat> 50.5174185242504</geo:lat>
        <geo:long> 2.89355007000268</geo:long>
        <description>0;Croix:0;Marc en Baroeul:2,2;Orvault;</description>
        <geo:lat> 50.5635185725987</geo:lat>
        <geo:long> 2.83156916499138</geo:long>

As you can see a tag is geo:lat

these two points : is a real problem with this code:

$rss = simplexml_load_file('iris.xml');
foreach ($rss->channel as $channel) {
    foreach ($channel->item as $item) {    
        foreach ($item->description as $description) {
            print "longitude : {$item->geo:lat} <br />n";

I can’t change the tag name , of course.
Anybody can help me ? thanks in advance

the tag isn’t ‘geo:lat’ but ‘lat’.
geo: is just a prefix, to be used with a seperate namespace.
havn’t tryed but it should be possible to just use $item->lat

otherwise take a look at xpath:

edit: broken links

well no , this is not working…

Your links are broken

sry, right links are:

Sponsor our Newsletter | Privacy Policy | Terms of Service