Generating a simple XML document
In order to create a new XML document, you can use the XML Output step. In this recipe you will create a new XML file from a database containing information about books.
Getting ready
You will need a books
database with the structure described in Appendix A, Data Structures.
How to do it...
Perform the following steps:
Create a new transformation.
Drop a Table Input step, in order to obtain the book's information and type the following query:
SELECT id_title , title , genre , price , concat(lastname,", ",firstname) author FROM books LEFT JOIN authors ON authors.id_author=books.id_author
Add an XML Output step.
In the Filename textbox of the File tab, type the destination filename, including its complete path (without extension). In the Extension textbox, leave the default value,
xml
.Fill the Content tab as Parent XML element, type
Books
and as the Row XML element, typeBook
.Under the Fields tab, use the Get Fields button to get the fields. In the...