Hello, I'm trying to map XML feeds fields to a drupal users entity.
How to map custom XML nodes names? currently I can only use from a list of predefined fields where none of them match my source fields name.

CommentFileSizeAuthor
Screen Shot 2016-08-30 at 5.25.52 PM.png58.05 KBmqanneh

Comments

mqanneh created an issue. See original summary.

megachriz’s picture

Status: Active » Fixed

Short answer: this functionality is not yet available for D8.

Long answer:
It should be implemented in the D8 version of the Feeds extensible parsers module. I've worked on that port a while ago - MegaChriz's sandbox: Feeds extensible parsers D8 - but it is unfinished: there is no UI for it yet. I had it however working successfully at some point by creating the configuration manually in a YAML-file and then importing that file at admin/config/development/configuration/single/import.

The module probably needs to be updated to "work" with the latest dev of Feeds and the latest version of Drupal.
If you want to try out the module without needing to update its code first for the latest Feeds and Drupal, try it with Drupal 8.0.0-beta9 and a Feeds dev version from April 2015. You would also need to comment out the following lines in feeds_ex/src/Feeds/Parser/ParserBase.php:

$fetcher_config = $feed->getConfigurationFor($feed->importer->fetcher);
$result->link = is_string($fetcher_config['source']) ? $fetcher_config['source'] : '';

Sample configuration for the parser only:
File name: feeds.feed_type.my_importer.yml

...
parser: xml
parser_configuration:
  use_tidy: false
  sources:
    title:
      label: Title
      value: 'title'
      raw: 0
      inner: 0
      debug: 0
      weight: '1'
    body:
      label: Body
      value: 'description'
      raw: 0
      inner: 0
      debug: 0
      weight: '1'
  context:
    value: //item
  display_errors: 0
  source_encoding:
    - auto
  debug_mode: 0
  line_limit: 100
...

Possible workaround:

  1. Create and configure a Feed type, but do not change the parser.
  2. Go to /admin/config/development/configuration/single/export and export the created feed type.
  3. On a D7 install of Feeds and Feeds extensible parsers configure the parser to your needs.
  4. Export the D7 Feeds importer.
  5. Convert the parser configuration from the D7 importer export to YAML and add this to the exported Feed type configuration from step 2. See sample configuration above for the format.
  6. Import the Feed type configuration on /admin/config/development/configuration/single/import.

There is an issue open for the D8 port of Feeds extensible parsers:
#2465535: [meta] Feeds extensible parsers 8.x roadmap

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.