Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/05/2010, 14:36
dariocasanova
 
Fecha de Ingreso: julio-2004
Mensajes: 19
Antigüedad: 19 años, 9 meses
Puntos: 0
Sonrisa Respuesta: Problema con Simplexml+XML+Atributos

Gracias por responder. Encontre la solucion en esta otra pagina:


http://www.willfitch.com/simplexml-tutorial-part1.html

simplemente era en vez de

foreach ($xml->items[0]->item as $item)

iba

foreach ($xml->item as $results)

por la sencilla razon que:

Código:
   
      <?php
   
      $file = ‘test_file.xml’;
   
      $xml = simplexml_load_file($file);
   
      /*
   
      The $xml object now has the top, parent node <cars>
   
      All nodes are referenced as properties, and node attributes are within an associative array in each of those properties.  
   
      If there are multiple nodes with the same name (<make> in this example), you will need to specify the index value to reference.  This is done as an array index.  The following code refences the "name" attribute in the first <make> node
   
      */
   
      echo $xml->make[0][‘name’];
  
      // Prints out "Ford" (without quotes)
  
      ?>
segun el autor del articulo que cite anteriormente
ojala le sirva de ayuda a alguien mas