Edit online

Import Database Data as an XML Document

To import the data from a relational database table as an XML document, follow these steps:

  1. Go to File > Import/Convert > Database Data to XML to start the Import wizard.

    This opens a Select database table dialog box that lists all the defined database connections:

    Figure 1. Select Database Table Dialog Box

  2. Select the connection to the database that contains the appropriate data.
    Only connections configured in relational data sources can be used to import data.
  3. If you want to edit, delete, or add a data source or connection, click the Configure Database Sources button.
    The Preferences/Data Sources option page is opened.
  4. Click Connect.
  5. In the list of sources, expand a schema and choose the required table.
  6. Click the Next button.

    The Import Criteria dialog box is opened with a default query string in the SQL Query pane.

    Figure 2. Import from Database Criteria Dialog Box

  7. Configure the settings for the conversion.
    1. SQL Preview - If this button is pressed, the Settings pane displays the labels that are used in the XML document and the first five lines from the database. By default, all data items are converted to element content ( symbol), but this can be overridden by clicking the individual column headers. Clicking a column header once causes the data from this column to be converted to attribute values ( symbol). Clicking a second time causes the column data to be ignored ( symbol) when generating the XML file. You can cycle through these three options by continuing to click the column header.
    2. Customize - This button opens a Presentation Names dialog box that allows you to edit the name, XML name, and conversion criterion for the root and row elements. The XML names can be edited by double-clicking the desired item and entering the label. The conversion criteria can also be modified by selecting one of the following option in the drop-down menu: ELEMENT, ATTRIBUTE, or SKIPPED.
    3. Import Settings - Clicking this button opens the Import preferences page that allows you to configure more import options.
    4. The XML Import Preview panel contains an example of what the generated XML document looks like.
    5. Open in editor - If selected, the new XML document created from the imported file is opened in the editor.
    6. Save in file - If selected, the new XML document is saved in the specified path.
    7. Generate XML Schema - Allows you to specify the path of the generated XML Schema file.
  8. Click Import to generate the XML document.