XML Provider for Sitecore 9.3 Data Exchange Framework 4.0 (Updated)

Some of us who had done research on how to integrate data from another source to Sitecore might have scanned through the Data Exchange Framework before. DEF is an ETL (Extract-Transform-Load) tool with a set of standards in preparing the whole integration process.

In this case we are extracting our data from an XML file. Then, we want to be able to transform this data to create items in Sitecore. In our example, we have <Employee> nodes defined in the Employee.xml. It looks like this:

Dheer Rajpoot in his blog has generously provided us with an XML Provider for Data Exchange Framework. However, with the emergence of new Sitecore and DEF’s versions, this tool has not been updated to support Sitecore 9.3 and Data Exchange Framework 4.0 (at least as of this writing), so I forked the old code from his repo and fixed the breaking changes.

You can download the updated XML Provider for DEF here. Main changes include:

  • Code adjustments (updated/removed implementations, added some improvements)
  • Demo files (provided Employee XML file, Sitecore templates, DEF Items)
  • TDS serialization (If you’re using TDS, you can Sync with Sitecore)

For an overview of how this XML Provider for Data Exchange Provider works, refer to this diagram:

Brief Explanation of the flow:

  1. The integration process starts with Running the Pipeline Batch
  2. This will call the first Pipeline, which is “Read XML file” that consists of one or more Pipeline Steps
  3. Prepare Endpoint to specify the source of data, in this case the Employee.xml file (included in the demo files too) and the node on which to read the data from
  4. Iterate through each <Employee> node, then call another Pipeline Step that will “Handle Single Row in the XML File”
  5. First step here is to “Resolve the Sitecore Item”. This is where you prepare your Item Creation (e.g. where you would like to generate the items, what template to use for, which values to use for item name, unique identifier, etc.)
  6. Set the Value Mapping Set to the “Apply Mapping” pipeline step to bind or map each XML Element to their Sitecore Template Fields represented by Value Accessors, which are Sitecore DEF items which are representations of fields both in Sitecore and XML Provider.

To run the demo, you need to install the following prerequisites:

Once done,

  • Navigate to this item and click Run Pipeline Batch in the ribbon:
    /sitecore/system/Data Exchange/Employees Tenant/Pipeline Batches/Employees XML to Sitecore Process
  • It should generate a list of Employees under this path:
    /sitecore/content/Home/Employees

If you can see those generated Sitecore items, congratulations! You now understand how Data Exchange Framework works. Pretty simple, right? 🙂


Leave a Reply