Reading simple XML files
PEDI has a step named Get XML Data used to read XML structures. This recipe shows how to read an XML file containing information about museums using this step.
Getting ready
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>
We will be making use of Path, which is used to query XML documents to retrieve and compute information. If you are new to Path, it is recommended to check out the excellent tutorials over at http://www.w3schools.com/xpath/ to get a better understanding of Path before digging into the recipe.
How to do it...
Perform the following steps:
Create a new transformation.
Drop a Get data from XML 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...