How to pass souce field to output port in XML reader?

Hi Clover experts,

I have a question about XML reader component.

I have a Excel file which has two columns: one is ID, the other is XML.
ID column has just single id value, but XML column has the actual XML souce data.

I can read XML column and parse it, but I want to pass ID column to output field using XML reader component.

EX.
souce file : ID, XML
souce meta : ID, XML
target meta : ID, XML_MOVIE, XML_DIRECTOR …

I am not sure how to explain what I want,

My point is I want to pass some souce fields to output port using XML reader component.

If it is not clear, would you let me know?

Thank you for any comments,

Bongki.

p.s.

I wrote the XML mapping like below, but it does not work

Hi Bongki,

ID is not a part of XML so you can not use it in XPath expressions in your mapping. You have basically two options:

A) The proper way is to use CloverETL Server with ExecuteGraph, pass the ID to the child graph as a parameter and fill the field ID with this parameter within the child graph.
B) You can use also CloverETL Designer but you have to work with the XML file as you would work with a common string. However, this solution is not recommended because it is basically unable to react to any possible errors in the xml file. You can split the string by the root element and add a new attribute ID to the root element, for example . Then you can use the attribute in your mapping. Please see my example.
xmlreader.zip
Regards,

Hi,

I really appreciate for your help,

Your graph is a good idea, and I tested XML extract instead of XML reader.

XML Extract component can pass the non-XML field.

Thank you,

Bongki.

Good point, XMLExtract is of course even better. I am sorry for not bringing it up earlier. I thought you have a reason for using XMLReader so I did not even consider the other components. My bad.

Regards,

Thank you very much for your warm advice,

Best Regards,

Bongki.