You are here

function node_export_xml_import in Node export 7.3

Import callback.

1 string reference to 'node_export_xml_import'
node_export_node_export_format_handlers in ./node_export.formats.inc
Implements hook_node_export_format_handlers().

File

formats/xml.inc, line 24
The Node export XML format handler.

Code

function node_export_xml_import($code_string) {

  // Check for "<?xml" at the start.
  if (substr(ltrim($code_string), 0, 5) == "<?xml") {

    // Decode the XML.
    $xml_class = new NodeExportXmlDecoder();
    $result = $xml_class
      ->decode($code_string);

    // Convert the nodes into objects.
    if (!isset($result['success'])) {
      foreach ($result as $k => $v) {
        $result[$k] = (object) $v;
      }
    }
    return $result;
  }
}