0

I have to import some data from a xml document.

I'm usuing the https://www.drupal.org/project/feeds and the https://www.drupal.org/project/feeds_xpathparser modules.

I have other fields which get the data with no problem at all. But I can't get a Select list to get the data from the xml.

XML LOOKS LIKE

<properties>
  <property>
    <type>House</type>
  </property>

  <property>
    <type>Flat</type>
  </property>

  <property>
    <type>Parking</type>
  </property>
</properties>

INFO OF THE field "Type" WHICH GET THE DATA:

Type:

List (text)

Control:

Selection List

Allowed values list:

House|House
Flat|Flat
Parking|Parking

THEN, IN THE FEED IMPORT SETTINGS:

-MAPPING: add the xpathparser selecting the field "Type"
-XPHATH XML PARSER - Settings: set the XPath for the field to "Type"

As far as I see everything is all right, but it doesn't work.

I have other fields in the same importer which get the data with no problem at all.

0

If you're on Drupal 7.x, you probably want to be using this module:

https://www.drupal.org/project/feeds_ex

This is the new home for no-longer actively maintained one (https://www.drupal.org/project/feeds_xpathparser)

I've been using feeds_ex and haven't had this problem.

Also, and I'm not sure about this, but I think the machine names for the list values should all be lowercase - but I could be wrong about this.

  • OK - I was wrong: case in the allowed values list doesn't matter, but I did have a problem like yours once and it was related to the allowed values list. I forgot until I just found this old question I posted. My problem was trailing spaces in the allowed values list: drupal.stackexchange.com/questions/120157/… – Anne Bonham Jun 25 '15 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.