Stockeo Help
  • What is Stockeo?
  • Update inventory from a Google Sheet
  • Update inventory from an XML feed
  • Create products from a JSON feed
  • Data Mapping
    • Format
      • CSV
      • JSON
      • XML
    • SKU
    • Price calculation
    • Quantity settings
    • Quantity format
    • Image URL settings
    • Variants
    • Metafields
    • Title
    • Description
    • Translations
    • Continue selling when out of stock
    • Charge tax
  • Filters
  • TROUBLESHOOTING
    • Invalid Closing Quote
    • Invalid Record Length
Powered by GitBook
On this page
  • Product Element
  • Variant Element
  • Enhanced XML Data Mapping
  • Extract data from an attribute
  1. Data Mapping
  2. Format

XML

PreviousJSONNextSKU

Last updated 3 months ago

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.

<Products>
    <Product>
        <Code>0260</Code>
        <Title>Sitting Jazz Band Saxophonist</Title>
        <Price>13.73</Price>
        <RRP>32.95</RRP>
        <AvailableStock>181</AvailableStock>
        <Barcode>5050140026007</Barcode>
        <Description>A sitting jazz man, playing the saxophone.</Description>
        <Image>https://www.hill-interiors.com/images/giant/0260.jpg</Image>
    </Product>
    <Product>
        <Code>0261</Code>
        <Title>Sitting Jazz Band Trumpeter</Title>
        <Price>13.73</Price>
        <RRP>32.95</RRP>
        <AvailableStock>162</AvailableStock>
        <Barcode>5050140026106</Barcode>
        <Description>Bring timeless musical elegance to any setting with the Sitting Jazz Band
            Trumpeter.</Description>
        <Image1>https://www.hill-interiors.com/images/giant/0261.jpg</Image>
    </Product>
</Products>

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

Variant Element

Fill in this field only when variants are nested in the product node.

<Products>
    <Product>
        <Code>0260</Code>
        <Title>Sitting Jazz Band Saxophonist</Title>
        <Description>A sitting jazz man, playing the saxophone.</Description>
        <Image>https://www.hill-interiors.com/images/giant/0260.jpg</Image>
        <Variants>
            <Variant>
                <VariantCode>0260S</VariantCode>
                <Price>13.73</Price>
                <RRP>32.95</RRP>
                <AvailableStock>181</AvailableStock>
                <Barcode>5050140026007</Barcode>
                <Option>Small</Option>
            </Variant>
            <Variant>
                <VariantCode>0260M</VariantCode>
                <Price>20.59</Price>
                <RRP>32.95</RRP>
                <AvailableStock>56</AvailableStock>
                <Barcode>5050140026008</Barcode>
                <Option>Medium</Option>
            </Variant>
            <Variant>
                <VariantCode>0260L</VariantCode>
                <Price>30.89</Price>
                <RRP>32.95</RRP>
                <AvailableStock>74</AvailableStock>
                <Barcode>5050140026009</Barcode>
                <Option>Large</Option>
            </Variant>
        </Variants>
    </Product>
</Products>

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:

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.

<product id="3378" currency="EUR" code_on_card="01269" producer_code_standard="OTHER" type="regular" vat="23.0" site="7">
  <names>
    <name xml:lang="eng"><![CDATA[Wooden Clock With Nickel Details]]></name>
    <name xml:lang="hun"><![CDATA[Fa óra nikkel részletekkel]]></name>
    <name xml:lang="pol"><![CDATA[Drewniany zegar z niklowymi dodatkami]]></name>
  </names>
  <stock quantity="443" available_stock_quantity="443" stock_quantity="443.000"/>
  <images>
    <large>
      <image iaiext:priority="1" url="https://www.hill-interiors.com/images/giant/19184.jpg" width="750" height="562"/>
      <image iaiext:priority="2" url="https://www.hill-interiors.com/images/giant/19185.jpg" width="750" height="562"/>
    </large>
    <icons>
      <icon url="https://www.hill-interiors.com/images/19186.jpg" 15:25:09" width="400" height="299"/>
    </icons>
  </images>
</product>

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.

@id

To extract an attribute value from a node nested within <product>, enter the child node name, slash, @ sign and attribute name.

stock/@available_stock_quantity

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:

names/name[@xml:lang='eng']

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.

images/large/image[@iaiext:priority="1"]/@url
images/large/image[@iaiext:priority="2"]/@url

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
XML settings
Product Element
Variant Element
Data Mapping section with Variant Element
Stockeo Product Element in the XML automation
Use the attribute of the stock node in the Stockeo automation
Use the attribute of the stock node in the Stockeo automation
Select node with a specific attribute in the Stockeo automation
Pull data from attribute of a node with specific other attribute in Stockeo automation
Stockeo Product Element in the XML automation annotated
Use the id attribute of product node in the Stockeo automation
Select node with a specifi attribute in the Stockeo automation annotated
Pull data from attribute of a node with specific other attribute in Stockeo automation annotated