Skip to main content

Import your data with an XML Feed (legacy document)

The Productsup platform converts XML files into a compatible format via a custom XML parser on import.

To ensure the Productsup XML parser can read your XML files, format them as follows:

  • Use a "tree structure" with defined roots, trees, and sub-trees.

  • The root node contains all product nodes.

  • Each node consists of a name (=column name) and a value (=content).

Sample XML file:

8fcf372938b4778b2302e14193a316ac.png

You must also configure your Productsup account to accept data from XML files.

In Data Sources , you can configure the data with an XSLT. An XSLT (Extensible Stylesheet Language Transformations) is a template that takes the roots from your XML, parses them, and returns the data to the platform in a format you specify.

Note that if you added an XML data source written before July 2017, the platform offers you a more recent XML parser in Data Sources. A more recent parser provides greater functionality.

8775be951ab88cd045b708b83cdb9189.png

Configure the root node

The root node specifies the starting point for the import. When you first import an XML file, the Productsup parser scans the file and defines a root node automatically. This root node appears in Root Node Suggestions. If the parser detects the wrong root node, you must specify one manually.

If you must enter a root node manually, review the following cases and update Data Sources according to the case relevant to your XML file.

  • Standard case

Insert the node containing all of your products, for instance, products, items, entries, so that the parser can identify them. In this case, it is not necessary to know the name of individual product tags. You only need to specify the group.

af9f4c28881ff107197dd607ccee4b2a.png

For this example, you would enter products in the root node field to import everything in the group. Each entry under <item> imports as a new row.

  • Non-standard case

If your group, <products> in this example, contains irrelevant tags for your import, it is not sufficient to enter its node in the field.

Enter the name of the exact node containing your single items and add an exclamation mark after the term. In this example, the XML parser only imports your products and ignores everything else in the group tag.

51cae1409c51a414a49d73f61990af56.png

Example: In this case, <name> is irrelevant, so enter item! in the root node to import these products only.

  • Inheritance Case

In this example, your XML contains information such as price and title that requires assigning to each variant. Therefore, you must add the entire node to the variant in the root node input field.

8c6ddfe7081d934e82ffed065517ae2f.png

Example: In this example, you need to enter feed>product_list>productsin the root node field because the "products" tag contains information on all of your variants. The attributes that each variant should inherit are inside "product_list."

On import, the feed has the following structure:

size

product_@attributes_lang

product_list_name

product_list_title

product_list_price

Medium

en

products UK

Red Shirt

20 GBP

Extra Large

en

products UK

Red Shirt

20 GBP

Small

en

products US

Blue Shirt

30 USD

Extra Small

esp

products US

Blue Shirt

30 USD

Nodes with a value inside the tag name are "tag attributes", here: <products lang="en">. They import with an @-sign.

Note that if your XML file has inheritance logic and a non-standard case, you can add the exclamation mark inside the full path.

  • Import specific products

If you want to import only certain products from a feed, you can include tag attributes, sequences , or a combination of both in your root node input.

Example: tag attributes - If you want to import only Spanish products, enter products lang=esp in the root node field.

Example: sequences - If you want to import only products originating from the US, enter products #2 in the root node field.

Example: tag attributes and sequences: If you want to import only products in English from the US feed. Enter products lang=en #2 in the root node field and the parser searches for the second occurrence of "products" second for the attribute "lang=en."

Define the maximum depth for the parser

After defining the root note, you must next define the depths of nodes for the parser. The parser ignores anything beyond the maximum depth.

Defining the maximum depth reduces import time significantly as the parser can move through your feed more quickly.

Note that you count XML levels from 0 as the first digit, which corresponds to the <feed> tag in this example:

45b2fd6d767ae6a950979da7d0b1241f.png

Bundle repeating nodes and bundle a delimiter

Multiple nodes in the XML file are output as separate columns by default. However, you can bundle repeating nodes/attributes as one column.

Enter a delimiter to separate repeating attributes in the undle delimiter. A semicolon is the default delimiter.

cd6b2e07adb41b978e96d25de952634a.png

Example: This XML file specifies multiple color variations per size. By default, the parser would output this file in the platform in this format:

title

size

color_1

color_2

color_3

color_4

T-Shirt

Medium

Yellow

Red

Blue

T-Shirt

Large

Yellow

Red

Blue

Green

However, if you enter 3 into Bundle repeating nodes and set comma as a delimiter, the XML file outputs in this format:

title

size

color

T-Shirt

Medium

Yellow, Red, Blue

T-Shirt

Large

Yellow, Red, Blue, Green, Pink, Purple