TextConverter

XML Editing

The functions for processing XML files or texts with an XML structure can be found in the TextConverter in the area "Actions > XML" on the right side of the main window. With these functions it is possible to edit texts or text files as part of an XML structure. This means that, for example, you can edit the XML structure directly (for example with the actions for deleting or adding elements or attributes) or you can apply actions only in certain tag names, attribute names, attribute values or inner texts.

This tutorial explains all of these options for XML processing with the TextConverter and is divided into the following sections:

If you want to edit texts differently than within an XML structure, you can use the functions to process texts as a whole, to process lines or to process texts within a CSV structure.

Elements, Tag Names, Attribute Names, Attribute Values and Inner Texts

In the TextConverter and in this tutorial, the terms "element", "tag name", "attribute name", "attribute value" and "inner text" are used. So that there are no misunderstandings, we first look at what these terms are used for within the XML structure:

<TagName AttributeName="Attribute Value">Inner Text</TagName>

In this example, we have given each part of the XML structure the name that is used in the TextConverter and in this tutorial for this component. The term "element" is used in the sense of the entire line shown here. "Element" stands for everything that is located between the first < of the opening tag and the last > of the closing tag, including the characters < and >.

Selection of Inner Texts, Tag Names and Elements

All XML actions for editing inner texts, tag names or elements offer the possibility of selecting those inner texts, tag names or elements to which the respective processing should be applied. Since this selection function respectively the available selection options are always the same for all relevant actions, we would like to explain the procedure in general first in order not to have to address it again later in the explanation of each individual action.

Basically, two options are available, depending on whether you want to edit all inner texts, all tag names respectively all elements or only a selection of inner texts, tag names or elements:

The selectors supported by the TextConverter widely correspond to the usual CSS selectors, which can be used, for example, in HTML documents for assigning CSS rules. As in CSS, several of these selectors can be listed together separated with a comma.

So far regarding the simplest selectors. Of course, you can additionally also use many of the other well-known selectors with the TextConverter, such as selectors that choose elements based on specific characteristics of their attributes or selectors that refer to the position of an element in the XML structure. However, explaining all of these selectors would go beyond the scope of this tutorial.

Selection of Attribute Names and Attribute Values

Also the actions for editing attribute names and attribute values within an XML structure offer the opportunity to limit the processing to the attributes of certain elements. Here, too, either a limiting selector can be specified for the elements to be processed or the option "All Elements" can be activated to select the attributes of all elements. The functionality of this element selection is identical to the selection of elements for the processing of inner texts, tag names and elements that we have discussed in the last section.

In addition to this element selection, the actions for processing attribute names and attribute values also offer another way to limit the processing to specific attributes: the selection via the attribute name. Again, there is the possibility to specify one or more attribute names to which the processing should be limited, or to select the "All Attribute Names" option.

Let's take a look at four examples demonstrating this:

As you can see, the function for selecting elements and attributes is very powerful and enables almost any restriction of the processing to your desired elements and attributes.

Actions for XML Processing

The following actions are available for XML editing in the current version of the TextConverter:

In order to limit the scope of these actions to certain inner texts, tag names, elements, attribute names or attribute values, please note the two sections Selection of Inner Texts, Tag Names and Elements as well as Selection of Attribute Names and Attribute Values.

Conversion of Data into the XML Format

With the help of the TextConverter, you can not only edit existing XML data, but also convert non-XML data into the XML format. The functions in this regard can be found in the TextConverter under "Actions > Format". For example, there is a function for the conversion of CSV data into the XML format. With this function, the fields of the CSV data can be integrated either as nodes or as attributes into the XML structure.