Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/07/2012, 11:40
Serenity
 
Fecha de Ingreso: marzo-2002
Mensajes: 299
Antigüedad: 22 años, 1 mes
Puntos: 1
Respuesta: Obtener nodos internos en XML

Ya hice una corrección

Código PHP:
Ver original
  1. foreach($xml->pelicula->children() as $obteneractores ){
  2.  var_dump($obteneractores);
  3. }

Y ya veo resultados:

object(SimpleXMLElement)[3]

object(SimpleXMLElement)[5]

object(SimpleXMLElement)[3]
public 'actor' =>
array (size=2)
0 =>
object(SimpleXMLElement)[5]
public 'nombre' => string 'Isabel' (length=6)
public 'personaje' => string 'Interpreta a mujer pelicula 1' (length=29)
1 =>
object(SimpleXMLElement)[6]
public 'nombre' => string 'Juan' (length=4)
public 'personaje' => string 'Interpreta a hombre pelicula 1' (length=30)


Pero por qué no me devuelve todos los actores, deberían ser 4, dos por cada película.

Qué estoy haciendo mal??