tengo un xml parecido al siguiente
Código XML:
Ver original<?xml version='1.0' encoding='UTF-8'?>
<feed>
<entry>
<id></id>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<category scheme='http://gdata.youtube.com/schemas/2007/categories.cat' term='People' label='Gente y blogs'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='buenafuente'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='la sexta'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='andreu buenafuente'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='gala goya'/>
<media:group>
<media:category label='Gente y blogs' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>People</media:category><media:content url='http://www.youtube.com/v/cEyFx_rVChk?f=videos&app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='133' yt:format='5'/>
<media:content url='rtsp://v5.cache5.c.youtube.com/CiILENy73wIaGQkZCtX6x4VMcBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='133' yt:format='1'/>
<media:content url='rtsp://v4.cache2.c.youtube.com/CiILENy73wIaGQkZCtX6x4VMcBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='133' yt:format='6'/>
<media:description type='plain'></media:description>
<media:keywords>buenafuente, la sexta, andreu buenafuente, gala goya</media:keywords>
<media:player url='http://www.youtube.com/watch?v=cEyFx_rVChk&feature=youtube_gdata_player'/>
<media:thumbnail url='http://i.ytimg.com/vi/cEyFx_rVChk/0.jpg' height='240' width='320' time='00:01:06.500'/>
<media:thumbnail url='http://i.ytimg.com/vi/cEyFx_rVChk/1.jpg' height='90' width='120' time='00:00:33.250'/>
<media:thumbnail url='http://i.ytimg.com/vi/cEyFx_rVChk/2.jpg' height='90' width='120' time='00:01:06.500'/>
<media:thumbnail url='http://i.ytimg.com/vi/cEyFx_rVChk/3.jpg' height='90' width='120' time='00:01:39.750'/>
<media:title type='plain'>Buenafuente encargado de presentar los Goya</media:title>
<yt:duration seconds='133'/>
</media:group>
</entry>
</feed>
soy capaz de acceder a varias etiquetas pero me resulta imposible obtener los de los campos que tienen : o los campos que no tienen contenido en su interior sino como una propiedad de la etiqueta
alguien sabe como se hace eso?
yo tengo esto
Código PHP:
Ver original//$xml = str_replace("media:","mediax",$xml);
foreach ($xml->entry as $message){
print("<div style='border:solid 1px #000000'>");
print("<p style='color:red;'>".$message->title.'</p>');
print("<p style='color:red;'>".$message->content.'</p>');
print("<p style='color:red;'>".$message->author->name.'</p>');
print("</div>");
}
He tratado de hacer el reemplazo que se ve comentado pero no va tampoco