# Rule for rewriting categories in XML

How to rewrite categories into XML? Categories can be edited using the Edit Element rule.&#x20;

First choose Export -> Edit

![](/files/iIu1w57qDfNHw3GExhVQ)

Then go to Rules -> New rule

![](/files/5cCvtBehVRuSQxgp7iLt)

In the next menu, choose Edit Element

![](/files/LpvBHU4DptSI4v79WQ0I)

Let's name the rule first. Then, in the condition, we select the categorytext that contains the text (or is equal to it) and specify the category that we will rewrite in the XML.

Next, select an element to edit. This is again the categorytext. Then choose to overwrite the value of the element and start typing the name of the category. The whisperer allows us to choose the exact name of the category according to the comparison shopping site.

In the example below, we rewrite the category Dermocosmetics (on the e-shop) to the category Heureka.sk | Cosmetics and health Cosmetics | Skin cosmetics | Special skin care (this is required category according to Heureka.sk).

![](/files/M7HpS7LaJNJiV5UdUpAb)

You can also set a rule with a condition, eg "If the name contains .... then the category will be ...".&#x20;

Sample below.

![](/files/7H11Fy8bCCmb011Efh0S)

In the settings of the element to be modified, select CATEGORYTEXT.&#x20;

Below in the Element content option, click on the bulk transcript.

![](/files/th6Q2denOxfIPQVqWgkM)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.conviu.com/data-editing-xml-and-csv/rule-for-rewriting-categories-in-xml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
