PDI has a step named Get XML Data used to read XML structures. This recipe shows how to read an XML file containing the information about museums using this step.
In this exercise, you will use a file named museum.xml
with the following structure:
<museums> <museum id_museum= '…'> <name>…</name> <city>…</city> <country>…</country> </museum> </museums>
Carry out the following steps:
Create a new transformation.
Drop a Get XML Data step from the Input category into the canvas.
Under the File tab, you must select the XML document. Browse for the file
museums.xml
and click on the Add button.Under the Content tab, type
/museums/museum
in the Loop XPath textbox. This will be the current node.Under the Fields tab, you need to specify the fields by using XPath notation. Use the Get Fields button...