Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to map the source to the target using XSLT 2.0

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The source is:
<?xml version="1.0" encoding="UTF-8"?>

<getEmpAssignHistoryOutputCollection xmlns="http://xmlns.oracle.com/cloud/adapter/database/getEmpAssignHistory_REQUEST/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <getEmpAssignHistoryOutput>

  <RNUM>1</RNUM>

  <LAST_UPDATE_DATE>2021-05-01T14:26:54.000+04:00</LAST_UPDATE_DATE>

  <CREATED_DATE>2020-10-06T14:26:54.000+04:00</CREATED_DATE>

  <Asset_Name>XXX</Asset_Name>

  <Asset_ID>101994</Asset_ID>

  <Effective_End_Date_ xsi:nil="true" />

  <Effective_start_Date>2020-04-02T00:00:00.000+04:00</Effective_start_Date>

  <Last_Promotion_Date>2020-04-02T00:00:00.000+04:00</Last_Promotion_Date>

  <Supervisor_Name>Hani Barhoush</Supervisor_Name>

  <Supervisor_ID>104</Supervisor_ID>

  <Grade_Name>3</Grade_Name>

  <Job_Name>Head Of Brazil Office</Job_Name>

  <Job_ID>1678602</Job_ID>

  <Organization_Name>Brazil/LatAm</Organization_Name>

  <Organization_ID>3930</Organization_ID>

  <Employee_Full_Name>Oscar Pekka Fahlgren</Employee_Full_Name>

  <Person_ID>9167</Person_ID>

  <EMPLOYEE_NUMBER>11472</EMPLOYEE_NUMBER>

 </getEmpAssignHistoryOutput>

 <getEmpAssignHistoryOutput>

  <RNUM>2</RNUM>

  <LAST_UPDATE_DATE>2021-05-01T14:26:54.000+04:00</LAST_UPDATE_DATE>

  <CREATED_DATE>2020-10-06T14:26:54.000+04:00</CREATED_DATE>

  <Asset_Name>XXX</Asset_Name>

  <Asset_ID>101994</Asset_ID>

  <Effective_End_Date_>2019-07-31T00:00:00.000+04:00</Effective_End_Date_>

  <Effective_start_Date>2018-10-01T00:00:00.000+04:00</Effective_start_Date>

  <Last_Promotion_Date>2018-10-01T00:00:00.000+04:00</Last_Promotion_Date>

  <Supervisor_Name>Omar Mohamed Eraiqaat</Supervisor_Name>

  <Supervisor_ID>271</Supervisor_ID>

  <Grade_Name>4I</Grade_Name>

  <Job_Name>Senior Analyst</Job_Name>

  <Job_ID>989659</Job_ID>

  <Organization_Name>Mubadala Capital</Organization_Name>

  <Organization_ID>639</Organization_ID>

  <Employee_Full_Name>Mohamed Rashed Al Mehairi</Employee_Full_Name>

  <Person_ID>141692</Person_ID>

  <EMPLOYEE_NUMBER>13062</EMPLOYEE_NUMBER>

 </getEmpAssignHistoryOutput>

 <getEmpAssignHistoryOutput>

  <RNUM>3</RNUM>

  <LAST_UPDATE_DATE>2021-05-01T14:26:54.000+04:00</LAST_UPDATE_DATE>

  <CREATED_DATE>2020-10-06T14:26:54.000+04:00</CREATED_DATE>

  <Asset_Name>XXX</Asset_Name>

  <Asset_ID>101994</Asset_ID>

  <Effective_End_Date_>2019-04-01T00:00:00.000+04:00</Effective_End_Date_>

  <Effective_start_Date>2017-05-01T00:00:00.000+04:00</Effective_start_Date>

  <Last_Promotion_Date>2017-05-01T00:00:00.000+04:00</Last_Promotion_Date>

  <Supervisor_Name>Adib Martin Mattar</Supervisor_Name>

  <Supervisor_ID>2566</Supervisor_ID>

  <Grade_Name>4I</Grade_Name>

  <Job_Name>Senior Principal</Job_Name>

  <Job_ID>989820</Job_ID>

  <Organization_Name>Private Equity Investments</Organization_Name>

  <Organization_ID>7480</Organization_ID>

  <Employee_Full_Name>Adnan Azam</Employee_Full_Name>

  <Person_ID>7868</Person_ID>

  <EMPLOYEE_NUMBER>11314</EMPLOYEE_NUMBER>

 </getEmpAssignHistoryOutput>

</getEmpAssignHistoryOutputCollection>

The Mapper file attached

* the target is:

<?xml version="1.0" encoding="UTF-8" ?>
<root>
 <initiatorSystem>OIC</initiatorSystem>
 <lastUpdateDate>05/05/2021</lastUpdateDate>
 <createdBy>OIC</createdBy>
 <employees>
   <employeeNumber>11472</employeeNumber>
   <personId>9167</personId>
   <organizations>
     <organizationId>3930</organizationId>
     <organizationName>Brazil/LatAm</organizationName>
     <jobId>1678602</jobId>
     <jobName>Head Of Brazil Office</jobName>
     <grade>4I</grade>
     <supervisorId>104</supervisorId>
     <supervisorName>Hani Barhoush</supervisorName>
     <lastPromotionDate></lastPromotionDate>
     <effectiveStartDate>01/04/2020</effectiveStartDate>
     <effectiveEndDate></effectiveEndDate>
     <assetName>MIC</assetName>
     <assetId>12345</assetId>
   </organizations>
   <organizations>
     <organizationId>3930</organizationId>
     <organizationName>Brazil/LatAm</organizationName>
     <jobId>1678602</jobId>
     <jobName>Head Of Brazil Office</jobName>
     <grade>4I</grade>
     <supervisorId>104</supervisorId>
     <supervisorName>Hani Barhoush</supervisorName>
     <lastPromotionDate></lastPromotionDate>
     <effectiveStartDate>01/04/2020</effectiveStartDate>
     <effectiveEndDate>01/04/2020</effectiveEndDate>
     <assetName>MIC</assetName>
     <assetId>12345</assetId>
   </organizations>
 </employees>
 <employees>
   <employeeNumber>12225</employeeNumber>
   <personId>64163</personId>
   <organizations>
     <organizationId>6975</organizationId>
     <organizationName>Venture Capital</organizationName>
     <jobId>989821</jobId>
     <jobName>Senior Principal</jobName>
     <grade>4I</grade>
     <supervisorId>3084</supervisorId>
     <supervisorName>Amer Muhieddine Alaily</supervisorName>
     <lastPromotionDate></lastPromotionDate>
     <effectiveStartDate>01/02/2020</effectiveStartDate>
     <effectiveEndDate></effectiveEndDate>
     <assetName>BMS</assetName>
     <assetId>12345</assetId>
   </organizations>
 </employees>
 <employees>
   <employeeNumber>13062</employeeNumber>
   <personId>141692</personId>
   <organizations>
     <organizationId>639</organizationId>
     <organizationName>Mubadala Capital</organizationName>
     <jobId>989659</jobId>
     <jobName>Senior Analyst</jobName>
     <grade>4I</grade>
     <supervisorId>9854</supervisorId>
     <supervisorName>Khalifa Hamad Ahmed Al Hajeri</supervisorName>
     <lastPromotionDate></lastPromotionDate>
     <effectiveStartDate>01/08/2019</effectiveStartDate>
     <effectiveEndDate></effectiveEndDate>
     <assetName>MIC</assetName>
     <assetId>12345</assetId>
   </organizations>
 </employees>
 <employees>
   <employeeNumber>12909</employeeNumber>
   <personId>112204</personId>
   <organizations>
     <organizationId>7416</organizationId>
     <organizationName>CEO Office - Technology, Manufacturing & Mining</organizationName>
     <jobId>1697587</jobId>
     <jobName>Executive Director, Mergers & Acquisitions - Tmm</jobName>
     <grade>4I</grade>
     <supervisorId>6438</supervisorId>
     <supervisorName>Ahmed Yahia</supervisorName>
     <lastPromotionDate></lastPromotionDate>
     <effectiveStartDate>01/04/2020</effectiveStartDate>
     <effectiveEndDate></effectiveEndDate>
     <assetName>BMS</assetName>
     <assetId>12345</assetId>
   </organizations>
 </employees>
 <employees>
   <employeeNumber>11314</employeeNumber>
   <personId>7868</personId>
   <organizations>
     <organizationId>7480</organizationId>
     <organizationName>Private Equity Investments</organizationName>
     <jobId>1456602</jobId>
     <jobName>Director</jobName>
     <grade>4I</grade>
     <supervisorId>2566</supervisorId>
     <supervisorName>Adib Martin Mattar</supervisorName>
     <lastPromotionDate></lastPromotionDate>
     <effectiveStartDate>01/04/2019</effectiveStartDate>
     <effectiveEndDate></effectiveEndDate>
     <assetName>BMS</assetName>
     <assetId>12345</assetId>
   </organizations>
 </employees>
</root>

 
Marshal
Posts: 26915
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Seems to me that you need to transform a getEmpAssignHistoryOutput node in the source into anemployees node in the target. Then within those nodes there's going to be other such rules, and likewise the root in the source is a getEmpAssignHistoryOutputCollection node and it needs to be transformed into a root node in the target.

This sort of thing is exactly what XSLT is designed for so it shouldn't be too hard to do it, once you have identified all of the transformations necessary. What problems are you having so far?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic