Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/02/2010, 00:44
Hecto_o_c
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Ayuda PHP + XML WebServices

Curiosamente yo estoy haciendo algo similar... solo que con "SimpleXML" pues me parece mas facil.

Yo lo haría así:

Código PHP:
<?php
$xml 
= new SimpleXMLElement(
'<?xml version="1.0" encoding="UTF-8"?> 
<item>
<sistema> 
  <nombre_sistema>name1</nombre_sistema> 
  <codigo_sistema>cod1</codigo_sistema> 
  <nombre_enlace>name_enlace</nombre_enlace> 
  <fecha_creacion_enlace>fecha_enlace</fecha_creacion_enlace> 
  <fecha_eliminacion_enlace>fecha_del_enlace</fecha_eliminacion_enlace> 
  <tipo_permiso>permiso_simple</tipo_permiso> 
  <estado>activo</estado> 
</sistema>
</item>
'
);

foreach (
$xml->children() as $sistema) {
    echo 
"Nombre de sistema: " $sistema->nombre_sistema "<br/>";
    echo 
"Codigo de sistema: " $sistema->codigo_sistema "<br/>";
    echo 
"Nombre de enlace: " $sistema->nombre_enlace "<br/>";
    echo 
"Fecha creacion enlace: " $sistema->fecha_creacion_enlace "<br/>";
    echo 
"Fecha eliminacion enlace: " $sistema->fecha_eliminacion_enlace "<br/>";
    echo 
"Tipo de permiso: " $sistema->tipo_permiso "<br/>";
    echo 
"Estado: " $sistema->estado "<br/>";
}


?>