cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new record as a Tag using XSLT Mapping

former_member201264
Active Contributor
0 Kudos

Hi Gurus,

I have the following Source Structure:

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

<ns0:MTS xmlns:ns0="urn:test.com:Test">

   <row>

      <ID>10</ID>

      <Name>John10</Name>

      <City>Chicago10</City>

   </row>

   <row>

      <ID>20</ID>

      <Name>John20</Name>

      <City>Chicago20</City>

   </row>

</ns0:MTS>

I need the following Target Structure with extra once new record whenver it process:

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

<ns0:MTS xmlns:ns0="urn:test.com:Test">

   <row>

      <ID>ID</ID>

      <Name>Name</Name>

      <City>City</City>

   </row>

   <row>

      <ID>10</ID>

      <Name>John10</Name>

      <City>Chicago10</City>

   </row>

   <row>

      <ID>20</ID>

      <Name>John2</Name>

      <City>Chicago2</City>

   </row>

</ns0:MTS>

I came to know that XSLT mapping good to do this job.

Please send me the XSLT code for the same OR any other method using UDF or any method..

I have seen the below link it is good but i am new to XSLT Maping.

http://scn.sap.com/thread/1205781.

Regards,

Sreeni.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you know the list of field names in design time, then you can simply duplicate the target structure with values in the first occurrence of the target node is populated with the field names. Second occurence can be used to map the actual data. No XSLT

Warm Regards,

Karthik

former_member201264
Active Contributor
0 Kudos

Hi Karthik,

I did  this by adding one XML line of code

<xsl:copy-of select="ns0:MT_SCG_GEM_eMailNotifications/node()" />

in XSL achieved.

I also tried in your way, it is also good idea then XSLT but i did the same using XSL Mapping.

Thank you.

Regards,

Sreeni.

Answers (0)