Procedure
-
Open the Basic settings view of the
tFileInputXML component by double-clicking the component and
specify the following properties:
-
Click the [...] button next to Edit
schema to define the schema for this component and then click
Yes to propagate the schema and close the schema
editor.
In this example, the input file has three columns: City, District, and Street, which are all set as String data type. The following figure shows the columns added for the schema.
The columns appears in the Column field of the Mapping table.
-
Enter the path to the areas.xml file
("D:/obs/areas.xml" in this example) in the
File name/Stream field.
You can also enter the file path by clicking the [...] button to the right of this field and navigating to the areas.xml file.
- Enter the XPath of the street element of the areas.xml in the Loop XPath query field ("/areas/area/street" in this example).
- Enter the XPaths of the city and district attributes and the XPath of the street node of the areas.xml file in the XPath query column of the Mapping table, as shown in the following figure.
- Leave the other options as they are.
-
Click the [...] button next to Edit
schema to define the schema for this component and then click
Yes to propagate the schema and close the schema
editor.
-
Open the Basic settings view of the
tLogRow component by double-clicking the component and select
Table (print values in cells of a table).
- Save your Job and press F6 to execute it.
Results
The city, district, and street values are extracted from the XML file and displayed on the console.