AnsweredAssumed Answered

XML to XML mapping in Kettle

Question asked by Farhan Ansari on Nov 30, 2018

We have a requirement where we have to read an XML  and write it in a Custom defined format. A sample of the output XML is available. For reading the XML , we are easily able to use the “Get Data From XML” component in the PDI and it is able to read data . I want to map the source XML columns directly to the target XML, without writing any custom code. Is there a way in PDI we can map the source to direct XMLs directly

 

Examples are

 

Source xml is

<root>

<name>Tom</name>

<age>32</age>

<year>1970</year>

</root>

 

Expected Output format

 

<employee>

<dob>1970</dob>

<custom>

<grt>32</grt>

</custom>

<defineproperties></defineproperties>

<person>Tom</person>

</employee>

 

So looking at the above I wanted to directly do a mapping between <name> in source to <person> under <defineproperties>

Similiarly <age> in  source maps to <grt> under <custom> in target

And likewise <year> maps to </year> in <dob> in target

 

Is there a UI mapping which I can do between 2 XMLs . I do not want use a Stylesheet component , and I do not want use a custom scripting here. Is there a way PDI is able to give a UI mapping between two XMLs in a UI without writing a code or a custom logic.

 

 

I am using Pentaho Data Integration Version 7.1 Community Edition

Outcomes