0

I make a drupal_http_request to a server which sends me response data as the XML which is considered string in the Drupal server.

How do I parse this string as XML or convert this string into XML and then extract the information I am looking for?

hakre
  • 193,403
  • 52
  • 435
  • 836
ssD
  • 339
  • 2
  • 9
  • 22

1 Answers1

1

Add the result inside a simpleXmlIterator object.

If the string is really a XML you'll be able to parse it.

As I just saw inside the documentation

You may do something like this

$obj = drupal_http_request($url);

$feed = new SimpleXmlIterator($obj->data);
David Level
  • 353
  • 2
  • 16