XML supplier feeds
How to read nested XML supplier feeds with record paths, variants, name/value pairs and category dictionaries, and how to shape XML exports.
Paths instead of columns
An XML feed has no columns. The module turns each repeating product element into a row, and you refer to values by simple paths:
| Path | Reads |
|---|---|
title | The text of the child element <title>. |
pricing/amount | A nested element. |
@sku | The attribute sku of the product element. |
features/feature*0 | The first of several repeated <feature> elements. *1 is the second. |
Paths are simple paths, not free XPath. Namespaces are compared by their local name. DTDs and external entities are rejected for security. A single product element can be up to 2 MiB.
Find the record path
- Choose XML as File format and upload the file or enter its URL.
- Open Supplier feed options and press Discover XML nodes. The module lists the element paths of the document and how many times each appears.
- Copy the path of the element that repeats once per product, for example
catalog/products/product, into XML record path in Source & destination. It cannot contain an index such as*0. - Press Obtain columns. The paths found inside each product become the available source columns.
An example feed
<catalog>
<categories>
<category id="0" parent="">Supplier</category>
<category id="11" parent="0">Shirts</category>
</categories>
<products>
<product sku="SHIRT">
<title>Shirt</title><price>1.234,56</price><category_id>11</category_id>
<features><feature name="Material">Cotton</feature></features>
<variants>
<variant sku="SHIRT-M"><stock>2</stock><attribute name="Size">M</attribute></variant>
<variant sku="SHIRT-L"><stock>3</stock><attribute name="Size">L</attribute></variant>
</variants>
</product>
</products>
</catalog>The sections below configure this feed step by step.
Variants
When combinations are nested inside the product, enter their path relative to the product in XML variant path (for example variants/variant), here variants/variant. Each variant becomes its own row, carrying the product's values too. In the mapping, refer to variant values with variant/, for example variant/@sku and variant/stock.
Name and value pairs
Features and attributes are often written as repeated elements with a name and a value. Press Add correlated XML pairs to turn them into one column in the Name=Value|Name=Value format that features and combination_attributes expect:
| Setting | What it does |
|---|---|
| Pair type | Product pairs are read from the product, Variant pairs from each variant. |
| Repeated node path | The repeated element, relative to the product or variant. Here features/feature for product pairs and attribute for variant pairs. |
| Name path / @attribute | Where the name is. Here @name. |
| Value path / . | Where the value is. . is the element's own text. |
| Output source column | The name of the new column, for example feature_pairs or variant_pairs. |
| Text pair separator (optional) | For elements written as Name: Value, the separator, for example :. Only the first occurrence is used. |
| HTML description column (optional) | Creates another column with the complete list as HTML, which a conditional value can append to the description. |
Up to 16 pair definitions per profile.
External XML category dictionary
Some feeds give each product only a category ID and list the category tree elsewhere in the document. Open External XML category dictionary and enable Resolve category IDs through another XML node:
| Setting | Example value |
|---|---|
| Category record path | catalog/categories/category |
| Category ID path | @id |
| Parent ID path | @parent |
| Category name path | . |
| Product category ID column | category_id |
| Resolved category path column | category |
The module builds the full path of each product's category, here Supplier > Shirts, in the column you name. Use that column in Category mapping. The dictionary accepts up to 20,000 categories and 128 levels; cycles and missing parents are reported.
Mapping for the example
| Source | Destination |
|---|---|
@sku | reference |
title | name |
price | price, with Numeric format 1.234,56 |
variant/@sku | combination_reference |
variant/stock | combination_quantity |
feature_pairs | features |
variant_pairs | combination_attributes |
With category mapping on the category column, mapping Supplier > Shirts to one of your categories, this feed produces two combination rows of one product.
XML exports
When you export to XML, these options appear under Supplier feed options:
| Setting | What it does |
|---|---|
| XML export root node | The outer element. Default products. A path such as catalog/products creates nested elements. |
| XML export record node | The element per product or combination. Default product. |
| Wrap XML text in CDATA | Writes text values inside CDATA sections. Some channels require it for descriptions with HTML. |
The Destination names in the mapping become element names. They can be nested, such as details/title, or attributes, such as product@id or @sku. Each output path must be unique and use valid XML names.
Still need help?
Open a support ticket from your account and our team will look at your store with you.