I use Node export module with Views Bulk Operations with XML format. When I download the created code, the file begins with the 3 bytes of BOM (Byte Order Mark).

The problem is, that when I upload the file on an other site, the node_export_xml_import function checks the first 5 chars:

/**
 * Import callback.
 */
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;
  }
}

But as the first 3 chars are BOM, I always get this error message:

'Node export was unable to recognize the format of the supplied code. No nodes imported.'

Any ideas?
Thanks in advance!

Comments

lv46gl created an issue. See original summary.

lv46gl’s picture

Title: H » Node import from xml file with BOM