Tengo un problema con el análisis de XML de una respuesta de pago de Google. El XML proviene directamente del servidor de Google, por lo que no hay ningún problema con el XML en sí.SimpleXmlElement y XPath, obteniendo el conjunto vacío()
me quiere agarrar de todas las etiquetas de nuevo desde el pedido de notificación
he intentado esto, pero conseguir una matriz vacía() volvió cada vez.
$xml = new SimpleXmlElement($raw_xml);
$notifications = $xml->xpath('notifications');
$notifications = $xml->xpath('/notification-history-response/notifications/new-order-notification');
$notifications = $xml->xpath('//new-order-notification');
Un snipet XML (sólo el principio)
<notification-history-response xmlns="http://checkout.google.com/schema/2" serial-number="c5cda190-0eb1-4f91-87cd-e656e5598d38">
<notifications>
<new-order-notification serial-number="271578974677716-00001-7">
<buyer-billing-address>
<address1>19 sandbox st</address1>
<address2></address2>
* El XML proviene directamente del servidor de google, por lo que no hay ningún problema con el XML en sí. * Sí, Google es casi como @Jon Skeet en ese sentido. Su XML está bien formado por definición. ;-) – LarsH