0% found this document useful (0 votes)
190 views

Creating A XML File Using - Composer and Hjoin Steps Within Hierarchical Data Stage

This document provides steps to create an XML file from multiple flat files using the Composer and HJoin steps in the Hierarchical Data stage in Informatica. It involves using 3 input files (address, employee, phone), an XSD schema, the Hierarchical Data stage to join the data hierarchically, and the XML Composer step to output the data as an XML file based on the schema. Key steps include importing the schema, adding HJoin steps to create lists of addresses and phone numbers for employees, configuring the XML Composer with the schema and output path, letting it automatically map fields, and validating the output XML file.

Uploaded by

pallavi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views

Creating A XML File Using - Composer and Hjoin Steps Within Hierarchical Data Stage

This document provides steps to create an XML file from multiple flat files using the Composer and HJoin steps in the Hierarchical Data stage in Informatica. It involves using 3 input files (address, employee, phone), an XSD schema, the Hierarchical Data stage to join the data hierarchically, and the XML Composer step to output the data as an XML file based on the schema. Key steps include importing the schema, adding HJoin steps to create lists of addresses and phone numbers for employees, configuring the XML Composer with the schema and output path, letting it automatically map fields, and validating the output XML file.

Uploaded by

pallavi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Creating a XML file using - Composer and HJoin steps within Hierarchical Data stage

Here we will use the HJoin step to create a hierarchical structure from the multiple relational data files (lists)
based on the parent and child keys.

We will be using 3 different input flat files - employee.txt, address.txt and phoneNumber.txt and the schema
file Employee.xsd to compose source data into an XML file.

Please find below link document for step by step Process

Stages Used: Sequential File and Hierarchical Data

Input Files Used:

1) Address File

address.txt

2) Employee File

employee.txt

3) Phone Number Details File

phoneNumber.txt

Schema File used:

Employee.xsd

Job Design:

Step 1: Create a New Parallel Job (FileToXMl)

Step2: Add 3 sequential file stages and name each stage as: Address_File, Employee_File and
PhoneNumber_File

Step3: Add the Hierarchical Data from Real Time


Step4: Connect each sequential file stage to the Hierarchical Data stage and give meaningful link names as
seen below in the screenshot

Step5: Use the following information to add a job parameter by name root_folder

Prompt Input path


Type String
Help Text Point to the root of the file tree folder

Step6: Configure the sequential file input stage by giving – column names, file path/file name to use and turn
on first line is column names option to True

Address
Employee

PhoneNumber

Step7: Open the Hierarchical_Data stage and click on Edit Assembly

Before proceeding further, we need to import the schema for our example (employee.xsd) file into the library
to be used later. This can be done by following the steps below

Step7.1: From the Assembly Editor, click the Libraries tab to open the Schema Library Manager.
Step7.2: To create a library for the example schemas, click New Library. For the library name,
enter Schemas_for_XML_examples. For the category, enter Examples. The library is now categorized under
Examples
Step7.3: Expand the Examples category, select Schemas_for_XML_examples, and then click Import New
Resource. Find the Employee.xsd and import into the library.

Step8: Within assembly editor, click on Palette and add step – H-Pivot and rename the step to
phoneNumber_HJoin Step

Step9: Click on phoneNumber_HJoin Step and configure it as shown in the screenshot below by selecting the
options highlighted as below. This is to create a list of Phone Numbers within the Address for a particular
addressID and employeeID

Step10: Similar to step 8, click on Palette and add step – H-Pivot and rename the step to address_HJoin Step
and configure it as shown in the screenshot below by selecting the options highlighted as below. This is to
create a list of addresses within the employee for a particular employeeID
Step11: Click on palette and add step XML_Composer. Configure the XML_Composer step as shown below.
Under XML Target option under configuration tab, provide the output path (click on insert parameter and
select the job parameter root_folder) and output XML file name needed as shown

Step12: Next , configure the DocumentRoot option under XML_Composer step configuration tab, by
selecting the schema employee.xsd which you imported into library previously

Step13: Configure the validation option to Minimal validation as shown in the screenshot below:
Step14: Next is to map input vs output by using the Map Automatically option under the Mappings. This step is
to translate the relational data we have in our sequential files into a hierarchical structure

Step15: Save the options, click ok in the stage to save changes. Save, compile and run the job by passing valid
value to the parameter root_folder (the path where your input files are located)

Step16: Open the XML output file created by the job by browsing to root_folder path and opening the file
employee_output.xml. Below is a screenshot of the XML file created by the job

You might also like