How to build an xml file within PowerCenter?

Thursday, April 21, 2016

This blog post describes how to build an xml file with Informatica Powercenter, considered as a rather complicated task. So this blog post explains the basics in this matter.

So the first thing you have to do, is create a target. You can either generate a target from an xml-file or an xsd-file. If possible, I would always go for the xsd-file as this defines the complete structure while an example xml might only contain a part of the needed information. Once you import a target, it will look like this:



Inside the Informatica Powercenter Designer, the target looks like this:




You can see the XPK and FK fields, these will not be present inside the xml file, but are used to define the relationship between the elements. The main thing to remember is that Informatica treats the xml-file as multiple target (one for each element in the xml). This means you can use active transformations and point to the same target-object, but different elements. This way you can split 1 source record into different elements by adding an aggregator in parallel with the lower level records. To do this you’ll need to define the Primary Key for the lowest level (eg. A payment id) and define a dummy PK for the element above (eg debit-account). You then point the dummy PK to the FK field in the lower level and the PK field in the higher level. This way all the payments with the same dummy PK will be a child of the same debit-account.

This makes it possible to create a fully structured xml in a relatively simple way. In fact, Informatica Powercenter is one of the best tools to do this.


Good luck!