-
Book Overview & Buying
-
Table Of Contents
Talend Open Studio Cookbook
By :
This recipe shows how we can convert an XML record stored in a file into a format that is readable by tXMLMap, and how we can then read and process the data in the XML record.
Open the job jo_cook_ch09_0010_readXMLFile.
The first stage of this process is to convert the XML file into Java Document format for use by the downstream component.
Drag a tFileInputXML component onto the canvas.
Edit the schema and add a column named payload. Make it a type of Document, as shown in the screenshot:

Open the tFileInputXML component and change the File name/Stream field to context.cookbookData+"/chapter9/chapter09_jo_0010_customerData.xml".
Change the Loop Xpath query field to "/".
Add an
Xpath query of ".", and tick the box Get Nodes.
Your tFileInputXML should look like the one shown in the next screenshot:

Reading using tXMLMap
Add a tXMLMap component to the canvas and link to the tFileInputXML component.
Open the tXMLMap component and right-click on payload...