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.
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.
Perform the following steps: