Import xml with Feeds module. Only one value is imported I have a xml (http://pastebin.com/q64L3ECX) that I need to import with Feeds module into my site. Basically, with this xml example, I need to import 3 nodes where my GUID (set as unique) is "test_case". Each test_case is inside a test_set.

The problem is that I can only get the first test_case of each of the two test_set of that file. Can someone help me understand what is wrong?



Debug output:

xpathparser:0 :
&lt;test_set_name tl_label="Name" tl_name="name" tl_physicalname="CY_CYCLE"&gt;GUI.00 Launch Applications&lt;/test_set_name&gt;
&lt;test_set_name tl_label="Name" tl_name="name" tl_physicalname="CY_CYCLE"&gt;GUI.02 EM NE.000 EM NE Generic.Generic EM NE tests&lt;/test_set_name&gt;
xpathparser:1 :
&lt;test_case_name tp_label="Test Name" tp_name="name" tp_physicalname="TS_NAME"&gt;Launch TNMS&lt;/test_case_name&gt;
&lt;test_case_name tp_label="Test Name" tp_name="name" tp_physicalname="TS_NAME"&gt;Open&lt;/test_case_name&gt;
&lt;test_case_name tp_label="Test Name" tp_name="name" tp_physicalname="TS_NAME"&gt;ManualNetworkScan&lt;/test_case_name&gt;

Created 1 node.
For example, our relation's key will be test case's GUID (Test cases (Entity reference by Feeds GUID) (field_test_cases)):


Content type test_set:


field_test_cases: Type - Entity Reference, Target type - Test case
(type test_case), Number of values - unlimited.

Content type test_case: standard Title and Body fields.


Test case's importer's config:

$feeds_importer = new stdClass();
$feeds_importer-&gt;disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer-&gt;api_version = 1;
$feeds_importer-&gt;id = 'test_cases';
$feeds_importer-&gt;config = array(
  'name' =&gt; 'Test cases',
  'description' =&gt; '',
  'fetcher' =&gt; array(
    'plugin_key' =&gt; 'FeedsFileFetcher',
    'config' =&gt; array(
      'allowed_extensions' =&gt; 'txt csv tsv xml opml html htm',
      'direct' =&gt; FALSE,
      'directory' =&gt; 'public://feeds',
      'allowed_schemes' =&gt; array(
        0 =&gt; 'public',
      ),
    ),
  ),
  'parser' =&gt; array(
    'plugin_key' =&gt; 'FeedsXPathParserXML',
    'config' =&gt; array(
      'sources' =&gt; array(
        'xpathparser:0' =&gt; 'text()',
        'xpathparser:1' =&gt; 'text()',
      ),
      'rawXML' =&gt; array(
        'xpathparser:0' =&gt; 0,
        'xpathparser:1' =&gt; 0,
      ),
      'context' =&gt; '/report/test_sets/test_set/test_cases/test_case/test_case_name',
      'exp' =&gt; array(
        'errors' =&gt; 0,
        'debug' =&gt; array(
          'context' =&gt; 0,
          'xpathparser:0' =&gt; 0,
          'xpathparser:1' =&gt; 0,
        ),
      ),
      'allow_override' =&gt; 1,
    ),
  ),
  'processor' =&gt; array(
    'plugin_key' =&gt; 'FeedsNodeProcessor',
    'config' =&gt; array(
      'expire' =&gt; '-1',
      'author' =&gt; 0,
      'authorize' =&gt; 1,
      'mappings' =&gt; array(
        0 =&gt; array(
          'source' =&gt; 'xpathparser:0',
          'target' =&gt; 'guid',
          'unique' =&gt; 1,
        ),
        1 =&gt; array(
          'source' =&gt; 'xpathparser:1',
          'target' =&gt; 'title',
          'unique' =&gt; 1,
        ),
      ),
      'update_existing' =&gt; '1',
      'update_non_existent' =&gt; 'skip',
      'input_format' =&gt; 'plain_text',
      'skip_hash_check' =&gt; 1,
      'bundle' =&gt; 'test_case',
    ),
  ),
  'content_type' =&gt; '',
  'update' =&gt; 0,
  'import_period' =&gt; '-1',
  'expire_period' =&gt; 3600,
  'import_on_create' =&gt; 1,
  'process_in_background' =&gt; 0,
);


Test set's importer's config:

$feeds_importer = new stdClass();
$feeds_importer-&gt;disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer-&gt;api_version = 1;
$feeds_importer-&gt;id = 'test_set';
$feeds_importer-&gt;config = array(
  'name' =&gt; 'Test set',
  'description' =&gt; '',
  'fetcher' =&gt; array(
    'plugin_key' =&gt; 'FeedsFileFetcher',
    'config' =&gt; array(
      'allowed_extensions' =&gt; 'txt csv tsv xml opml html htm',
      'direct' =&gt; FALSE,
      'directory' =&gt; 'public://feeds',
      'allowed_schemes' =&gt; array(
        0 =&gt; 'public',
      ),
    ),
  ),
  'parser' =&gt; array(
    'plugin_key' =&gt; 'FeedsXPathParserXML',
    'config' =&gt; array(
      'sources' =&gt; array(
        'xpathparser:0' =&gt; 'test_set_name/text()',
        'xpathparser:1' =&gt; 'test_set_name/text()',
        'xpathparser:2' =&gt; 'test_cases/test_case/test_case_name/text()',
      ),
      'rawXML' =&gt; array(
        'xpathparser:0' =&gt; 0,
        'xpathparser:1' =&gt; 0,
        'xpathparser:2' =&gt; 0,
      ),
      'context' =&gt; '/report/test_sets/test_set',
      'exp' =&gt; array(
        'errors' =&gt; 0,
        'debug' =&gt; array(
          'context' =&gt; 0,
          'xpathparser:0' =&gt; 0,
          'xpathparser:1' =&gt; 0,
          'xpathparser:2' =&gt; 0,
        ),
      ),
      'allow_override' =&gt; 1,
    ),
  ),
  'processor' =&gt; array(
    'plugin_key' =&gt; 'FeedsNodeProcessor',
    'config' =&gt; array(
      'expire' =&gt; '-1',
      'author' =&gt; 0,
      'authorize' =&gt; 1,
      'mappings' =&gt; array(
        0 =&gt; array(
          'source' =&gt; 'xpathparser:0',
          'target' =&gt; 'guid',
          'unique' =&gt; 1,
        ),
        1 =&gt; array(
          'source' =&gt; 'xpathparser:1',
          'target' =&gt; 'title',
          'unique' =&gt; 1,
        ),
        2 =&gt; array(
          'source' =&gt; 'xpathparser:2',
          'target' =&gt; 'field_test_cases',
          'unique' =&gt; FALSE,
        ),
      ),
      'update_existing' =&gt; '1',
      'update_non_existent' =&gt; 'skip',
      'input_format' =&gt; 'plain_text',
      'skip_hash_check' =&gt; 1,
      'bundle' =&gt; 'test_set',
    ),
  ),
  'content_type' =&gt; '',
  'update' =&gt; 0,
  'import_period' =&gt; '-1',
  'expire_period' =&gt; 3600,
  'import_on_create' =&gt; 1,
  'process_in_background' =&gt; 0,
);