Using the wizard for XML files

The DataMapper wizard for XML files helps you create a data mapping configuration for an XML file. The wizard lets you select the type of node and the trigger that delimit the start of a new record. Next, the wizard extracts the data in one extraction step.

This wizard can also be used to extract data from a JSON file. JSON files are automatically converted to XML.
If there is no root element in the JSON it will be added and each object without a named parent element is called an 'item'.
Note that in addition to being valid, the JSON should follow naming rules for XML elements. For example, "adress_line_1:" is a valid key name in JSON, but it cannot be converted to a valid element name in XML because the colon is reserved for namespaces. For XML naming rules and best naming practices, see: XML elements on W3Schools.

The wizard cannot create detail tables. If the file contains transactional data, the data mapping configuration is best created without a wizard (see Creating a new data mapping configuration).

There are two ways to open an XML/JSON file with a wizard: from the Welcome screen or from the File menu.

  • From the Welcome screen
    1. Open the PReS Connect Welcome page by clicking the icon at the top right or select the Help menu and then Welcome.
    2. Click New DataMapper Configuration.
    3. From the Using a wizard pane, select XML.
    4. Click the Browse button and select the file you want to work with. For a JSON file, change the file type to JSON first. Click Next.
  • From the File menu
    1. In the menu, click File > New.
    2. Click the Data mapping Wizards drop-down and select From XML File.
    3. Click Next.
    4. Click the Browse button and select the file you want to work with. For a JSON file, change the file type to JSON first. Click Next.

After selecting a file, you have to set the split level and trigger type:

  • XML Elements: This is a list of node elements that have children nodes. Select the level in the data that will define the source record.
  • Trigger: Select On element to create a record for each occurrence of the node element selected in the XML Elements field, or select On change to create a record each time the element is different. (Check the option to include attributes in the list of content items that can trigger a boundary.)

The DataMapper only extracts elements for which at least one value is defined in the file. Attribute values are not taken into account.
Attribute values (prefixed with an @ sign in the Data Viewer) are not extracted automatically.

Click Finish to close the dialog and open the data mapping configuration.