Using tXMLMap to create an XML document
This recipe is the reverse of the previous recipe, in that we'll be reading in a flat format and converting it to an XML document for output. It is recommended that you have understood the previous recipe prior to attempting this one.
Getting ready
Open the job jo_cook_ch09_0020_createXMLDocument
file.
How to do it...
The first stage of the process is to convert the input data into a Java Document that can store the XML.
Drag a
tXMLMap
component onto the canvas, and link thetFileInputDelimited
component to it.Create an output table named
customerDocumentOut
, and add a field namedpayload
. Make the field a type of Document.You will see that the field in the output table has changed to become a simple XML structure.
As we did in the previous recipe, retrieve the XML format from the file containing our target XML structure.
Drag the fields from input to output, and set the
countryOfResidence
component toUK
.Your
tXMLMap
component should look like the one in...