The steps for importing a text file into an XML file are the following:
-
Go to menu
The Select text file dialog box is
displayed.
-
Select the URL of the text file.
-
Select the encoding of the text file.
-
Click the OK button.
The Import Criteria dialog box is displayed:
Import from text file
The input data is displayed in a tabular form. The
XML Import
Preview panel contains an example of what the generated XML document looks
like. The names of the XML elements and the transformation of the first five lines from
the text file are displayed in the
Import settings section. All
data items in the input are converted by default to element content, but this can be
overridden by clicking the individual column headers. Clicking once a column header
causes the data from this column to be used as attribute values of the row elements.
Click the second time and the column's data is ignored when generating the XML file. You
can cycle through these three options by continuing to click the column header. The
following symbols decorate the column header to indicate the type of content that column
is converted to:
- <> symbols for data columns converted to element content
- = symbol for data columns converted to attribute content
- x symbol for ignored data
-
Select the field delimiter for the import settings:
- Comma;
- Semicolon;
- Tab;
- Space;
- Pipe.
-
Set other optional settings of the conversion.
The dialog offers the following settings:
- First row contains field names - If the option is enabled,
you will notice that the table has moved up. The default column headers are replaced
(where such information is available) by the content of the first row. In other words,
the first row is interpreted as containing the field names. The changes are also
visible in the preview of the XML document. To return to default settings (where the
first row is interpreted as containing data and not fields names), simply uncheck the
option.
- Change labels -This button opens a new dialog, allowing you
to edit the names of the root and row elements, change the XML name and the conversion
criterion.
The XML names can be edited by double-clicking the desired item and
entering the required label. The conversion criterion can also be modified by
selecting one of the drop-down list options: ELEMENT,
ATTRIBUTE, or SKIPPED.
- Open in editor - If checked, the
new XML document created from the imported text file is opened in the editor.
- Save in file - If checked, the new
XML document is saved at the specified path.
Note: If only Open in
editor is checked, the newly created document is opened in the editor,
but as an unsaved file.