1 # This migration demonstrates importing from multiple XML files.
2 id: wine_variety_multi_xml
3 label: XML feed of varieties
6 # We use the XML source plugin.
8 data_fetcher_plugin: http
9 data_parser_plugin: xml
10 # Normally, this is one or more fully-qualified URLs or file paths. Because
11 # we can't hardcode your local URL, we provide a relative path here which
12 # hook_install() will rewrite to a full URL for the current site.
14 - /migrate_example_advanced_variety_multiple/red?_format=xml
15 - /migrate_example_advanced_variety_multiple/white?_format=xml
16 # Visit the URL above (relative to your site root) and look at it. You can see
17 # that <response> is the outer element, and each item we want to import is a
18 # <position> element. The item_xpath value is the xpath to use to query the
20 item_selector: /response/variety
21 # Under 'fields', we list the data items to be imported. The first level keys
22 # are the source field names we want to populate (the names to be used as
23 # sources in the process configuration below). For each field we're importing,
24 # we provide a label (optional - this is for display in migration tools) and
25 # an xpath for retrieving that value. It's important to note that this xpath
26 # is relative to the elements retrieved by item_xpath.
33 name: category_details
38 label: 'Unique position identifier'
41 name: category_attributes
42 label: 'List of variety attributes'
44 # Under 'ids', we identify source fields populated above which will uniquely
45 # identify each imported item. The 'type' makes sure the migration map table
46 # uses the proper schema type for stored the IDs.
53 default_value: migrate_example_wine_varieties
55 description: category_details
59 source: category_parent
60 field_variety_attributes: category_attributes
62 plugin: entity:taxonomy_term
63 migration_dependencies:
69 - migrate_example_advanced