Blending Bull Rule: Delete XML Tag with Content#
The Delete XML Tag with Content rule provides a simple and fast way to remove entire elements from an XML file. Since Blending Bull works on a low-level basis (character level), this rule is designed to reliably identify and remove XML elements regardless of how they are written.
What is the rule for?#
The main goal is to simplify the process of cleaning XML files from unwanted data. It is ideal for situations where you:
-
Need to remove entire data sections from the feed that you do not need (e.g. parameters, descriptions in other languages, or technical tags).
-
Want to reduce the file size before further processing.
-
Need to remove invalid or corrupted data blocks that cause errors in other tools.
How does the rule work?#
Blending Bull uses logic similar to regular expressions to find the opening tag <ELEMENT> and its corresponding closing tag </ELEMENT>. The rule handles various ways an element can be written:
1. Text on a single line#
The rule removes an element where all the text is on one line with no line breaks (e.g. after applying the Align XML to Table rule).
Example:
<ELEMENT>Any text</ELEMENT>2. Text spanning multiple lines#
The rule also handles a format that contains line breaks or whitespace (spaces, tabs).
Example:
<ELEMENT>
Any text
</ELEMENT>3. Nested elements#
The rule also deletes all nested elements contained within the element marked for removal. So if you select ELEMENT for removal, SUBELEMENT1 and SUBELEMENT2 will also be deleted.
Example:
<ELEMENT>
<SUBELEMENT1>Any text</SUBELEMENT1>
<SUBELEMENT2>Other text</SUBELEMENT2>
</ELEMENT>4. Elements with parameters#
The rule reliably identifies and deletes elements that contain additional parameters.
Example:
<ELEMENT parameter_1="abc" parameter_2="def">Any text</ELEMENT>How to configure the rule#
-
In the interface of the selected file, on the Edit file tab, click Create new rule.
-
Enter a Name for the rule.
-
As the Rule type, select Delete XML tag with content.
-
In the relevant field, enter the name of the element you want to remove (e.g.
DESCRIPTION,PARAM, etc.). -
Click Save.
Advantages of using this rule#
Because Blending Bull does not store data in a database but processes it directly as a stream of characters, removing elements is exceptionally fast even for very large feeds. Unlike the Find and replace or Delete text rules, you do not need to know or deal with what is inside the element — the rule simply deletes it entirely from start to finish.
FAQ#
What exactly does the Delete XML Tag with Content rule do?#
It removes the entire selected element from the XML file, including all its content — both the text inside and any nested elements. Simply enter the element name and the rule takes care of the rest.
What data format is the rule designed for?#
The rule is designed for data sources in XML format. It does not apply to other formats such as CSV or JSON.
Does the rule handle elements that span multiple lines?#
Yes. The rule works regardless of whether the element is on a single line or spans multiple lines, including spaces and tabs.
Does the rule also delete nested elements inside the element being removed?#
Yes. If the element contains further nested elements, they will be removed along with it. There is no need to delete each nested element separately.
Can the rule handle elements with additional parameters?#
Yes. The rule reliably identifies and removes elements that contain additional parameters, for example <ELEMENT parameter_1="abc">.
What is the advantage of using this rule?#
You do not need to know or deal with the content of the element. The rule simply deletes the entire element from start to finish, regardless of what is inside. Additionally, because Blending Bull processes data as a stream of characters without writing to a database, removal is exceptionally fast even for very large feeds.
Where in Blending Bull do I configure the rule?#
In the interface of the selected file, go to the Edit file tab, click Create new rule, select Delete XML tag with content as the type, enter the name of the element you want to remove, and save.