cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping for CSV to Nested XML conversion in CPI

Ahmad1
Explorer
0 Kudos

Hi Folks,

We required XSLT code for converting CSV to Nested XML in SAP CPI. Please find below details for your reference.


CSV Input file :

H,30004,3333,USA,10,P1001

L,30004,1111,10,USA,10,P10033


XML Output file:

<?xml version="1.0" encoding="UTF-8"?>

<sales_orders>

<header>

<Sales_OrderNo>30005</Sales_OrderNo>

<OrderDate>2022/10/10</OrderDate>

<shipToCountry>USA</shipToCountry>

<Sales_Org>attune</Sales_Org>

<Po_Number>P1001</Po_Number>

</header>

<line_item>

<Sales_OrderNo>30005</Sales_OrderNo>

<lineItemNo>10</lineItemNo>

<productID>P1001</productID>

<quantity>10</quantity>

<price>7.50</price>

<amount>75.00</amount>

</line_item>

</sales_orders>

Regards,

Ahmad

Ryan-Crosby
Active Contributor

I'd suggest converting the CSV to XML before attempting any transformation with XSLT. XML input is needed for an XSLT to execute.

balazsbence95
Advisor
Advisor
0 Kudos

Hi,

If your question is not CPI-DS (Cloud Platform Integration for data services) related, please remove tag SAP Cloud Integration for data services and add your question to the thread that your SAP cloud product is dedicated to.

Thank you,

Bence

0 Kudos

Hi ahmad1989 , have you resolved this issue if yes please share the resources.

Thank You in advance.

Accepted Solutions (0)

Answers (0)