How To

Defining Inventory XML Fields

ChannelAdvisor supports the ability to upload your inventory information in an XML file format. An XML file may contain fields that are not recognized by the ChannelAdvisor system. A template can be used to map these fields and specify what data should be placed in the ChannelAdvisor inventory fields. However, in order to use a template you must first define the XPath Expressions that map the fields you are sending to ChannelAdvisor's inventory fields.

You can create up to 5 lists of XPath Expressions, each corresponding to one of your unique XML file formats. For example, if one of your XML files uses "Product" as the product node but another uses "Item", you can create different XML Fields lists for each of these formats. Once created, an XML Fields list can be specified on your XML template to map the fields you are sending to ChannelAdvisor's inventory fields.

XML files should have the following characteristics:

  • They must be well-formed XML. This wikipedia article does a good job explaining what well-formed XML is.
  • Text values should ideally be enclosed in CDATA sections to avoid problems with reserved XML characters.
  • They should validate against the ChannelAdvisor Generic feed specification. See the following section on validating XML.

 

Prerequisites


You should be familiar with the following topics before continuing:

 

Tasks to Complete


Before you can use an expression in a template, you must first create an XML Fields list on the Define XML Fields page. There are two ways to create new expressions when editing an XML Fields list: pasting sample XML or adding name/expression pairs one at a time.

Provide Sample XML

When creating your XPath Expressions, you can simply paste a section of your XML file into the sample section in ChannelAdvisor, and we will attempt to detect your fields for you. If any fields are interpreted incorrectly you will be able to change them while editing your XML Fields list.

  1. Go to the Inventory > Product Mapping > Define XML Fields page.
  2. Create a new XML Fields list by clicking on the button + Create New XML Fields List. Or edit an existing list by clicking on the Name of the list.
  3. Paste one sample node of your XML file into the box. 
    Please Note: You should provide ONLY ONE sample node.
  4. Click the Generate Fields button.
  5. The Name and Expression values will be populated with the field values detected in your XML sample.
  6. Review the fields and expressions, then click the Save button to save this list.

 

Adding Name:Expression Pairs

After adding a sample XML node and generating a list of name and expressions, you can add new XPath expression pairs one at a time to each list.

  1. Go to the Inventory > Product Mapping > Define XML Fields page.
  2. Click on the Name of the list you want to add Name:Expression pairs to.
  3. Scroll to the bottom of the Name:Expression list and click on the Add Field button.
  4. Enter a field Name and Expression.
  5. Review the fields and expressions, then click the Save button to save this list.

ChannelAdvisor supports the ability to upload your inventory information in an XML file format. An XML file may contain fields that are not recognized by the ChannelAdvisor system. A template can be used to map these fields and specify what data should be placed in the ChannelAdvisor inventory fields. However, in order to use a template you must first define the XPath Expressions that map the fields you are sending to ChannelAdvisor's inventory fields.

You can create up to 5 lists of XPath Expressions, each corresponding to one of your unique XML file formats. For example, if one of your XML files uses "Product" as the product node but another uses "Item", you can create different XML Fields lists for each of these formats. Once created, an XML Fields list can be specified on your XML template to map the fields you are sending to ChannelAdvisor's inventory fields.

XML files should have the following characteristics:

  • They must be well-formed XML. This wikipedia article does a good job explaining what well-formed XML is.
  • Text values should ideally be enclosed in CDATA sections to avoid problems with reserved XML characters.
  • They should validate against the ChannelAdvisor Generic feed specification. See the following section on validating XML.

 

Prerequisites


You should be familiar with the following topics before continuing:

 

Tasks to Complete


Before you can use an expression in a template, you must first create an XML Fields list on the Define XML Fields page. There are two ways to create new expressions when editing an XML Fields list: pasting sample XML or adding name/expression pairs one at a time.

Provide Sample XML

When creating your XPath Expressions, you can simply paste a section of your XML file into the sample section in ChannelAdvisor, and we will attempt to detect your fields for you. If any fields are interpreted incorrectly you will be able to change them while editing your XML Fields list.

  1. Go to the Inventory > Product Mapping > Define XML Fields page.
  2. Create a new XML Fields list by clicking on the button + Create New XML Fields List. Or edit an existing list by clicking on the Name of the list.
  3. Paste one sample node of your XML file into the box. 
    Please Note: You should provide ONLY ONE sample node.
  4. Click the Generate Fields button.
  5. The Name and Expression values will be populated with the field values detected in your XML sample.
  6. Review the fields and expressions, then click the Save button to save this list.

 

Adding Name:Expression Pairs

After adding a sample XML node and generating a list of name and expressions, you can add new XPath expression pairs one at a time to each list.

  1. Go to the Inventory > Product Mapping > Define XML Fields page.
  2. Click on the Name of the list you want to add Name:Expression pairs to.
  3. Scroll to the bottom of the Name:Expression list and click on the Add Field button.
  4. Enter a field Name and Expression.
  5. Review the fields and expressions, then click the Save button to save this list.
0
Your rating: None Average: 1 (2 votes)
0
Your rating: None Average: 1 (2 votes)
Tags