Need

This xDI tool is useful to transfer data from XML files into a relational database, creating tables and populating them with the XML content.

Summarized Solution

The "Replicator XML to RDBMS" tool provides a streamlined way to extract data from XML files and load it into a database. This involves dragging and dropping the XML source and the database target into a new process, configuring the tool's properties, and then executing the process.


Detailed Solution

Here's a step-by-step guide on how to use the tool:

1. Create a new process

  • Start by creating a new process in your environment.

  • In the Palette, navigate to the Tools menu.

  • From the Tools menu, locate and drag and drop the "Replicator XML to RDBMS" tool onto your process.

2. Drag and drop the source and target metadata

  • Source: Drag and drop your XML file's metadata link. This must be an XML root element (highlighted in the below image).

  • Target: Drag and drop the metadata link for your target database. This should be the schema node of your database, such as PostgreSQLOracle, etc.

You must rename the two metadata links to "TARGET" and "SOURCE".


3. Configure the tool

Now that source and target are set, you can configure the template options accordingly to your needs.



  • The “Filter” property allows to excluse some source XML fields from the replication. For example: 
    • exclude all xml nodes having a parent (or self) named “priceRange” : not(exists(ancestor-or-self::*[@name='priceRange']))
    • exclude elements with a given name: @name != 'elementName'
    • exclude elements of a given type: @type != 'typename'
    • exclude elements according to the occurrence indicated in metadata: not(@minOccurs=1 and @maxOccurs=1)
  • "In File Name" property allows to specify a generic file name. For ewample, if you need to retreive all files from a folder you can specify <root_folder>/**/*.xml

The Replicator does not allow to add specific fields to the generated data. But you cann do it as a second step using the SQL Operation tool.


4. Run the process

  • Once your source, target, and tool properties are configured, you can Run the Process.

  • Upon successful completion, you will find that tables have been created in your target database schema, and the data from your XML file(s) has been loaded into these tables.


Source XML file data:


Table and data created and loaded into the target database: