Tema: duda con xml
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/01/2021, 10:35
tuadmin
 
Fecha de Ingreso: abril-2006
Mensajes: 583
Antigüedad: 18 años
Puntos: 120
Respuesta: duda con xml

cuando se hace uso de "new SimpleXMLElement" necesitas tambien darle un ELEMENTO RAIZ. ya que esta procesando un XML en el constructor.
Código PHP:
Ver original
  1. $xml = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>");
deberia ser asi
Código PHP:
Ver original
  1. $xml = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?><response/>");

y en lugar de
Código PHP:
Ver original
  1. $item = $xml->addChild('response');

Código PHP:
Ver original
  1. //$item = $xml->addChild('response');
  2. $item = $xml;
__________________
Mis aportes te ayudaron??, te hicieron ahorrar valiosos tiempo??, si quieres puedes agradecerme con un Gracias o con una donacion
https://paypal.com/pools/c/8lmNLmWnG9