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 books information.
Getting ready
You will need a books' database with the structure described in the Appendix, Data Structures.
How to do it...
Carry out the following steps:
Create a new transformation.
Drop a Table Input step, in order to obtain the books' 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 Row XML element, typeBook
.Under the Fields tab, use the Get Fields button to get the fields. In the
price...