Tema: Xml+php
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/12/2009, 10:43
Avatar de jackson666
jackson666
 
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 6 meses
Puntos: 65
Respuesta: Xml+php

Deberias leer el manual respecto a las funciones DOM. Para hacer eso tenes que leer el XML instanciando la clase DOMDocument y usando sus metodos... Te dejo un ejemplo para leer el XML del clima de yahoo
Código PHP:
<?php
$dom
=DOMDocument::load("http://xml.weather.yahoo.com/forecastrss?p=ASXX0112&u=c");
$tagChannel=$dom->getElementsByTagName("channel");
foreach(
$tagChannel as $tgchn){
    
$tagItem=$tgchn->getElementsByTagName("item");
    foreach(
$tagItem as $tgItm){
        
$respuesta=$tgItm->getElementsByTagName("description")->item(0)->nodeValue;
        echo 
$respuesta;
    }
    }
?>