Editing a feed that has been working on my site for months. When I tried to edit the settings for XPath XML parser, it would not save the changes. It complains about the Context, which is "//videos/video". In fact, I can't get it to accept any selector at all for Context, including examples from the XPath parser documentation. Exported importer is as follows:
$feeds_importer = new stdClass();
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'experimental_video_importer';
$feeds_importer->config = array(
'name' => 'experimental video importer',
'description' => '',
'fetcher' => array(
'plugin_key' => 'FeedsFileFetcher',
'config' => array(
'allowed_extensions' => 'txt csv tsv xml opml html htm',
'direct' => 1,
'directory' => 'public://feeds',
'allowed_schemes' => array(
0 => 'public',
),
),
),
'parser' => array(
'plugin_key' => 'FeedsXPathParserXML',
'config' => array(
'sources' => array(
'xpathparser:0' => 'caption',
'xpathparser:2' => 'id',
'xpathparser:4' => 'gpslatitude',
'xpathparser:5' => 'gpslongitude',
'xpathparser:6' => 'useremail',
'xpathparser:7' => 'url',
'xpathparser:8' => 'id',
'xpathparser:9' => 'path',
),
'rawXML' => array(
'xpathparser:0' => 0,
'xpathparser:2' => 0,
'xpathparser:4' => 0,
'xpathparser:5' => 0,
'xpathparser:6' => 0,
'xpathparser:7' => 0,
'xpathparser:8' => 0,
'xpathparser:9' => 0,
),
'context' => '//videos/video',
'exp' => array(
'errors' => 1,
'debug' => array(
'context' => 'context',
'xpathparser:0' => 'xpathparser:0',
'xpathparser:2' => 'xpathparser:2',
'xpathparser:4' => 'xpathparser:4',
'xpathparser:5' => 'xpathparser:5',
'xpathparser:6' => 'xpathparser:6',
'xpathparser:7' => 'xpathparser:7',
'xpathparser:8' => 'xpathparser:8',
'xpathparser:9' => 'xpathparser:9',
),
),
'allow_override' => 0,
),
),
'processor' => array(
'plugin_key' => 'FeedsNodeProcessor',
'config' => array(
'expire' => '-1',
'author' => 0,
'authorize' => 1,
'mappings' => array(
0 => array(
'source' => 'xpathparser:0',
'target' => 'title',
'unique' => FALSE,
),
1 => array(
'source' => 'xpathparser:2',
'target' => 'guid',
'unique' => 1,
),
2 => array(
'source' => 'xpathparser:4',
'target' => 'field_location:locpick][user_latitude',
'unique' => FALSE,
),
3 => array(
'source' => 'xpathparser:5',
'target' => 'field_location:locpick][user_longitude',
'unique' => FALSE,
),
4 => array(
'source' => 'xpathparser:6',
'target' => 'user_mail',
'unique' => FALSE,
),
5 => array(
'source' => 'xpathparser:7',
'target' => 'path_alias',
'unique' => FALSE,
),
6 => array(
'source' => 'xpathparser:8',
'target' => 'field_staging_id',
'unique' => FALSE,
),
7 => array(
'source' => 'xpathparser:9',
'target' => 'field_video_file',
'unique' => FALSE,
),
),
'update_existing' => '0',
'input_format' => 'plain_text',
'skip_hash_check' => 0,
'bundle' => 'video',
),
),
'content_type' => 'video_feed',
'update' => 0,
'import_period' => '-1',
'expire_period' => 3600,
'import_on_create' => 0,
'process_in_background' => 0,
);
Feed data looks like this:
<?xml version="1.0"?>
<videos>
<video>
<id>1234</id>
<caption>My Video</caption>
<gpslatitude>40</gpslatitude>
<gpslongitude>-78</gpslongitude>
<path>public://media/myvideo.mov</path>
<useremail>myemail@google.com</useremail>
</video>
</videos>