Foros del Web » Programando para Internet » PHP »

STRING-XML convertir en ARRAY

Estas en el tema de STRING-XML convertir en ARRAY en el foro de PHP en Foros del Web. tengo un XML guardado en un campo de la Base de Datos con la siguente <?xml version="1.0" encoding="utf-8"?> <elements> <textarea identifier="83ba7366-d126-40f0-923e-3e7a94f0e773"> <value/> </textarea> <image identifier="246e955a-5a57-4ad0-ad8c-c15fc7bfccb6"> ...
  #1 (permalink)  
Antiguo 08/11/2011, 15:44
 
Fecha de Ingreso: junio-2010
Mensajes: 73
Antigüedad: 13 años, 9 meses
Puntos: 1
Mensaje STRING-XML convertir en ARRAY

tengo un XML guardado en un campo de la Base de Datos con la siguente

<?xml version="1.0" encoding="utf-8"?>
<elements>
<textarea identifier="83ba7366-d126-40f0-923e-3e7a94f0e773">
<value/>
</textarea>
<image identifier="246e955a-5a57-4ad0-ad8c-c15fc7bfccb6">
<file><![CDATA[images/stories/zoo/uploads/cartera 1.jpg]]></file>
<title/>
<link/>
<target/>
<rel/>
<width><![CDATA[600]]></width>
<height><![CDATA[600]]></height>
</image>
<image identifier="c0794696-a5d2-4df9-b20f-f23b0f94a41b">
<file><![CDATA[images/stories/zoo/uploads/cartera 1-1.jpg]]></file>
<title/>
<link/>
<target/>
<rel/>
<width><![CDATA[600]]></width>
<height><![CDATA[600]]></height>
</image>
<textarea identifier="beab45eb-b32a-4766-822d-b3fb72b5b1d4"/>
<gallery identifier="08416e3c-059f-4f0c-bbb1-82b871d1c021"/>
<rating identifier="fff9519f-3b36-4df5-8722-17db9f2ea31c">
<votes/>
<value/>
</rating>
<socialbookmarks identifier="00e1df62-828d-42f5-a1a6-a89d553d4934"/>
< identifier="64c188a6-cf2f-4895-8879-8b67a58b6780"/>
</elements>


--------------------------

Lo que necesito en sacar el valor del node FILE

AYUDENME PLEASE
  #2 (permalink)  
Antiguo 08/11/2011, 15:52
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: STRING-XML convertir en ARRAY

Hola chavewain2,

Te recomiendo ver este post: http://www.forosdelweb.com/f18/aport...ml-dom-792348/

Saludos.
  #3 (permalink)  
Antiguo 08/11/2011, 15:52
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: STRING-XML convertir en ARRAY

Usa la extensión SimpleXML:
http://php.net/simplexml
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #4 (permalink)  
Antiguo 08/11/2011, 16:00
 
Fecha de Ingreso: junio-2010
Mensajes: 73
Antigüedad: 13 años, 9 meses
Puntos: 1
Respuesta: STRING-XML convertir en ARRAY

me podria escribir un ejemplo estoy casi agotado de buscar en la web
  #5 (permalink)  
Antiguo 08/11/2011, 16:02
 
Fecha de Ingreso: junio-2010
Mensajes: 73
Antigüedad: 13 años, 9 meses
Puntos: 1
Respuesta: STRING-XML convertir en ARRAY

acabo de intentar con Simple Xml pero por alguna razon me devuelve esto

public 'file' =>
object(SimpleXMLElement)[354]
  #6 (permalink)  
Antiguo 08/11/2011, 16:04
 
Fecha de Ingreso: junio-2010
Mensajes: 73
Antigüedad: 13 años, 9 meses
Puntos: 1
Respuesta: STRING-XML convertir en ARRAY

Cita:
Iniciado por chavewain2 Ver Mensaje
acabo de intentar con Simple Xml pero por alguna razon me devuelve esto

public 'file' =>
object(SimpleXMLElement)[354]

esto solo ocurre con los NODOS que tiene <![CDATA[ al inicio
  #7 (permalink)  
Antiguo 08/11/2011, 16:40
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: STRING-XML convertir en ARRAY

¿Como dejaste tu código?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:03.