XML is a flexible, text-based format used for structuring and storing data, commonly used in web services and data exchange between systems.
Product Element
The key information required by Stockeo is the node name that contains the data for a single product.
In such a case above enter Product in the Product Element field.
Fields associated with the product are relative to the node used as Product Element:
Variant Element
Fill in this field only when variants are nested in the product node.
In such a case above enter Variants/Variant in the Variant Element field.
Fields associated with the variant are relative to the node used as Variant Element:
Continue selling when out of stock
An example feed mapping, where variant nodes are embedded within product nodes, may look as follows:
Data Mapping section with Variant Element Enhanced XML Data Mapping
Product data might sometimes be stored in XML attributes. To navigate through elements and attributes in an XML document Stockeo relies on XPath. You can use the XPath expressions to pull data from a node's attribute or to extract data from a node containing a specific attribute with a specific value.
Extract data from an attribute
It can be that the data you want to extract from an XML and use them for creating/updating products are stored as XML attributes.
In the above example, the node with all information about a product is <product>.
Stockeo Product Element in the XML automation The path to the nodes nested within it is relative. To get the id value which is the attribute of the product node, type the @ sign and attribute name.
Use the attribute of the stock node in the Stockeo automation To extract an attribute value from a node nested within <product>, enter the child node name, slash, @ sign and attribute name.
Use the attribute of the stock node in the Stockeo automation Select the node with the specific attribute
It may also happen you want to select a node with a specific attribute from which you need to extract data. Assume you would like to extract the product title from the name node containing the xml:lang="eng" attribute. In this case, provide the node name, and in the square bracket type the @ sign followed by the name of the attribute with its value. For our example XML it looks like this:
Select node with a specific attribute in the Stockeo automation Another example illustrates a combination of both: selecting a node with a specific attribute value and extracting data from the attribute to pull all product images from the feed.
Pull data from attribute of a node with specific other attribute in Stockeo automation