cancel
Showing results for 
Search instead for 
Did you mean: 

How to map one particular value in message mapping from multiple values

purusottam_agar
Explorer
0 Kudos

Hi Experts,

I am facing a challenge and need your suggestions for the below scenario.

input side XML: <ROOT>
<item>
<Type>S</Type>
<Message>Success</Message>
</item>
<item>
<Type>S</Type>
<Message>Success</Message>
</item>
<item>
<Type>F</Type>
<Message>Failed</Message>
</item>
</ROOT>

likewise multiple items are coming in the input xml and I want to map only the <Type>F</Type> and <Message>Failed</Message> in the target side. How to achieve this.

Best Regards,

Purusottam Agarwal

 

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor
0 Kudos

The following XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:mode on-no-match="shallow-copy"/>
    <xsl:template match="item[Type = 'S']"/>
</xsl:stylesheet>

produces this result XML:

<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
   <item>
      <Type>F</Type>
      <Message>Failed</Message>
   </item>
</ROOT>

 

Regards,

Ryan Crosby

Answers (0)