Attributes in elements

Have you encountered the need to work with attributes in elements when processing product data and don’t know what they are for or how to use them? In MERGADO Editor, which is based on XML Nomenclature, you can easily work with them and increase your sales. Let’s talk about what attributes in elements are and how MERGADO can help you with them.

What are attributes?

Simply put: XML files consist of elements that record information. And an attribute is a part of an element that specifies its meaning. They are the bearers of the refining value. These values must always be enclosed in quotes or apostrophes.

For example: If we wanted to create an XML file with the names of the party attendees and their gender, the structure using an attribute would look like this:

<person gender="female">




In the “person” element there is a “gender” attribute (purple color) with the value “female” (red color). This attribute specifies that Pavlína Nováková identifies herself as female.

Without the attribute, this entry could have this structure:






For example, Shoptet uses attributes for image captions:

Attributes in product feeds

For our personal purposes, it doesn’t matter what structure we write the birthday person in, as long as it’s functional. However, if we want to sell our products on various advertising portals, we may run into a problem. This is because some portals require sending product data with attributes in elements. Such portals are for example Ceneo, Heureka Availability or Shoptet.



<a name=”Producent”>Nike</a>


Heureka Inventory feed:


<item id="314141-120">


<delivery_time orderDeadline="2023-04-17 12:00">2023-04-26 12:00</delivery_time>




<IMAGE description="Columbia Squish N’ Stuff (Colour Green, Size L)">[ázev_obrázkujpg](< /IMAGE>

<IMAGE description="Columbia Squish N’ Stuff (Colour Green, Size L)">ázev_obrázku.jpg< /IMAGE>


In the case of an XML feed with products, the attributes are, for example, a SHOPITEM code specification or a specification of the source where the product image is located:







<IMAGE description="desc image"></IMAGE>


Note: Google does not use element and attribute partitioning in its nomenclature as XML files do. It only uses the attribute label (for both elements and attributes). See Google specification.

What are attributes for?

You can work with attributes across the entire MERGADO Editor. With these edits you can:

  • Offer your items on portals that require the use of attributes.
  • Remove unwanted attributes and override attribute values.
  • Create product selections based on attributes.
  • And work with them wherever element names appear: for example, in rules or MQL.

Attributes in MERGADO Editor

Attributes are recognized in the Editor by having the at sign @ at the beginning. Let’s show this with examples. We have the following input feed:







<IMAGE description="desc image"></IMAGE>




The feed contains the SHOPITEM element, which has the id attribute in it. Next, we see the IMAGE element with the desc attribute. In the MERGADO Editor we see the above mentioned attributes with an at sign:

Note: In the MERGADO Editor we can also encounter so-called special attributes. We can recognize them by starting with two at signs, e.g. @@POSITION.

Examples of usage

See examples of use:

1) Looking for products with size 30 shoes to select from the feed:


MERGADO 1: PARAM |Shoe size = "30"
MERGADO 2: PARAM {PARAM_NAME = "Shoe size"} | VAL = "30"

If we know the exact position of the element in the feed, the expression can also look like this:
MERGADO 2: PARAM { @@POSITION = 2 } | VAL = "30"
If the feed contains multi-value elements <VAL> with the value 30 at the second position within the feed, it will return all such products.

MERGADO 2: PARAM { @@POSITION = 3 } | VAL = "30"
There is no <VAL> with a value of 30 in in the third position. So the path (element-path) is not correct.

2) We are looking for an outfit whose size is greater than 1.



3) I want to change the negative value in the shipping price:


Create the selection as follows:

In the rule Bulk override values select the element:
and choose what values to overwrite with the new one.

Nothing has changed for simple elements!

4) Looking for gift boxes in CUSTOM_LABEL_0:

<CATEGORYTEXT>Food & Beverage | Food | Food Gift Baskets</CATEGORYTEXT>
<PRODUCT>Fitness box with crowbar, Box for men, Gifts for men, Gifts for women</PRODUCT>

MERGADO 1: CUSTOM_LABEL_0 = "Gift Boxes"
MERGADO 2: CUSTOM_LABEL_0 = "Gift Boxes"

5) I am looking for products where the name contains bed and the price is more than 4000,-


6) I am looking for a specific variant that contains the value “idvariant3” in the @id attribute of the <VARIANT> element.

<VARIANT id="idvariant3">

MERGADO 1: you can’t simply
MERGADO 2: VARIANTS | VARIANT | @id ~ "idvariant3"

7) I am looking for a category with id 123

Electronics Appliances

MERGADO 1: DEFAULT_CATEGORY(id=123) - wrong entry towards XML

8) Loading multi-value elements in MERGADO 1 and 2:


MERGADO 1: incorrectly as element IMGURL and IMGURL|1
MERGADO 2: you can target any element at any position in IMGURL { @@POSITION = 2 }

More information on how to work with multi-value elements: