This post i will show you how to create XML metadata using Talend and simple use of tFileinputXML component.
List of topics covering in this post.
Simple XMl Parsing using tFileInputXML.
Talend Open Studio
Source XML file for demonstration.
<PurchaseOrder PurchaseOrderNumber=”99503″ OrderDate=”1999-10-20″>
<Street>123 Maple Street</Street>
<Street>8 Oak Avenue</Street>
<DeliveryNotes>Please leave packages in shed by driveway.</DeliveryNotes>
<Comment>Confirm this is electric</Comment>
Step 1: Create XML Metadata using Talend.
Go to the Talend repository Metadata node and right click on File XML .
Provide valid name for metadata.
In third Step we have to find out which node should be our XPATH LOOP Expression? for that you can find out the leaf node or last node of XML, in above file <Item> is the leaf node, so we will take that one. see the screen for mapping.
Just Drag and drop all required columns from XML to see above
Once column selection completes then Click on preview button to review the extracted result.
If every thing looks fine then proceed with finish button which will take you to the next screen with generated schema, here you can change data type, column name, length if required.
Now our XML metadata ready to use, then just drag and drop xml schema to job design it will ask two component
For now we will use tFileinputXML to extract XML data, lets drop that.
Connect tlogRow to tFileinputXML component and execute the job you see the result, if result not displayed then repeat above steps.
This post we have created
Simple XML parsing.
Simple use of tFileinputXML component.
I am Software consultant with approx 7 years of experience mainly in Business Intelligence and data warehousing assignments using Talend.
Writing is not my passion but i am doing it to help others. if you have any special case where you want me to demonstrate then please post me.