XML
Last updated
Last updated
XML is a flexible, text-based format used for structuring and storing data, commonly used in web services and data exchange between systems.
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:
Title
Description
Image URL
Product Type
Tag
Vendor
Product Metafield
Fill in this field only when variants are nested in the product node.
If variants are in separate nodes at the product level and have a node with the same value for all variants of a specific product like product name, parent SKU, or parent ID, leave this field empty. For more information navigate to Variants.
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:
SKU
Barcode
Compare at price
Continue selling when out of stock
Charge tax
Cost per item
Market Price
Price
Quantity
Weight
Variant Metafield
Option
An example feed mapping, where variant nodes are embedded within product nodes, may look as follows:
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.
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>.
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.
To extract an attribute value from a node nested within <product>, enter the child node name, slash, @ sign and attribute name.
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:
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.