If you prefer an XML Feed, you should ensure that it is a valid feed. For this to be the case, you must meet some technical requirements, but you can always check the validity in an XML validator.

Below you can see an example of how an XML feed would be with the same tags as the previous case: id, name, product_url, description, category, subcategory, price and discount:


What technical requirements must an XML feed meet?

In order to avoid any failure when loading an XML feed, we recommend following these tips:

  1. Choose the granularity of your XML documents carefully
  2. Encode your XML documents in UTF-8 without BOM3. Well-formed XML documents
  3. The XML statements consist of a series of labels (called elements) with a series of modifiers (called attributes). The labels can be nested inside each other, but any label that is opened must be closed, and always in the same order.

    In case an element does not have a partner (because it has no content inside), it is called an empty element and it is indicated with a “/” at the end. The elements are grouped into documents, such as the following:

<? xml version = "1.0" encoding = 'iso-8859-1'?>
<home>
        <room id = 'dining room'>
                    <room_type> dresser </ room_type>
                    <furniture> sofa </ furniture>
                    <door a = 'balcony' />
         </ room>
</ home>

  • If DTD is not used, the document should start with a Standalone Document Declaration, such as the one on the first line.
  • All labels must be balanced, meaning that all elements that contain character data must have start and end labels.
  • All attribute values must be enclosed in quotation marks. The single quote character (the apostrophe) can be used if the value contains double quote characters, and vice versa. If you need both, use &apos; and &quot;
  • Any empty element (eg. those that do not have a final tag like <IMG>, <HR>, and <BR> and others of HTML) must end with '/>' or you must make them NOT EMPTY by adding an end tag, such as It looks in the door element.
  • There should be no isolated labels (<or &) in the text (eg it should be given as &lt; and  &amp;), and the sequence]]> should be given as]] & gt; if this does not occur as the end of a section marked as CDATA.
  • The elements must nest their properties within themselves (labels should not be superimposed, as in the rest of SGML);
  • Well-formed files without DTD can use attributes in their elements, but these must all be of the CDATA type, by default. The CDATA type (character DATA) are characters.
  • The names of the labels can be alphanumeric, starting with a letter, and including the characters - and :, although the latter has a special meaning.
  • It will not be able to contain the following characters unless they are escaped: " '<> & --> They should be as follows: "= & quot; '= &apos; <= &lt;> = &gt; & = &amp;


Other important tips are: 

  • In order to guarantee that the servers are not blocked, it is recommended that the size of the XML files does not exceed 20MB. 
  • The response time of XML documents should be as fast as possible (XML should be cached and not created in each request).

Valid protocols for the feed URL

HTTP or HTTPS are the only valid protocols for the Feed URL so an FTP protocol is not accepted.

Did this answer your question?