O'Reilly logo

Pentaho Data Integration 4 Cookbook by María Carina Roldán, Adrián Sergio Pulvirenti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading simple XML files

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.

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>

How to do it...

Carry out the following steps:

  1. Create a new transformation.
  2. Drop a Get XML Data step from the Input category into the canvas.
  3. Under the File tab, you must select the XML document. Browse for the file museums.xml and click on the Add button.
  4. Under the Content tab, type /museums/museum in the Loop XPath textbox. This will be the current node.

    Tip

    Alternatively, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required