cancel
Showing results for 
Search instead for 
Did you mean: 

xml name value pairs to plain text using MTB

Former Member
0 Kudos

Hello,

My requirement is to convert a simple xml to a text .

my input xml is:

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

<ns0:MT_samplexmlns:ns0="http://samplenamespace">

<Record>

<Name>DSRP</Name>

<Value>001</Value>

</Record>

<Record>

<Name>CSS</Name>

<Value>002</Value>

</Record>

<Record>

<Name>OMS</Name>

<Value>003</Value>

</Record>

</ns0:MT_sample>

Output should be:

^^Name,DSRP,Value,001,Name,CSS,Value,002,Name,OMS,Value,003^^

how to get the last and first 3 special characters in the output text using MTB? Please suggest.

Thanks & Regards,

Swetha.

Accepted Solutions (0)

Answers (2)

Answers (2)

abhay_rajhans2
Contributor
0 Kudos

Hi

Use constant with value "^^^" in message mapping and pass them while creating the target structure by concatenating with first and last node of target structure

Edited by: Rajhans Abhay on Nov 13, 2009 1:54 PM

former_member187339
Active Contributor
0 Kudos

Hi Sweta,

Why MTB??? Message Transformation bean is used to change the format of the message... If you are planning to call any XSLT or java mapping through that then you can give it a try..

>>how to get the last and first 3 special characters in the output text using MTB?

Put them in message mapping itself and write it in File

Regards

Suraj