cancel
Showing results for 
Search instead for 
Did you mean: 

Help required in xml to xml Mapping

former_member192892
Active Contributor
0 Kudos

Hi guys,

While performing mapping between two message types, where my input message type looks like..

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

<DATA>

<FNAME>

<LNAME>

<DATA>

and I'm using both the FNAME and LNAME nodes in the output file.

Here If I'm giving the input file format as...

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

<DATA>

<FNAME>Varun</FNAME>

<DATA>

This is without the LNAME tag...

I want to know, how can I assign a blank value to my output file structure for this particular tag???

I tried using a custom mapping with the code written below, but it didn't work

public String matchFields(String a,Container container){

//write your code here

String output;

if(a""l)

{

output = "";

}

else

{

output = a;

}

return output;

}

Please help me on this guys....Plzzz

Regards

Varun

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Use the standard node function "Exist" and "if" boolean function to achieve what you want

regards

krishna

Answers (3)

Answers (3)

former_member187437
Contributor
0 Kudos

Hi Varun,

Your code itself is working perfectly well for your requirements. Can you be more specific about your requirements?

former_member184619
Active Contributor
0 Kudos

hi Varun,

Just map it with a CONSTANT ( space ) in standard fun.

Sachin

former_member192892
Active Contributor
0 Kudos

But I want the value in the node, if I'm passing the node also...How can I achieve this????

former_member184619
Active Contributor
0 Kudos

Hi,

use it like this if Fname equals constnat[space] then pass the Constant[space] to Fname else value of Fname as under

................................Constant[]------>

FNAME.............................................Then

-


>Equals....................................IF -


>FNAME

Constant[].........................................ELSE

.......................................FNAME---->

Constant[] = Constant [ Space ]

Sachin

former_member192892
Active Contributor
0 Kudos

I'm sorry

Its a==null in the java code