cancel
Showing results for 
Search instead for 
Did you mean: 

Source XML to Target XML - Mismatch of Data

former_member192798
Active Contributor
0 Kudos

Hi,

My scenario involves picking an xml file from legacy and mapping it to a MDM business content (imported an XSD thro' external definition) and after transformation parking the output as xml in the target system.

My source xml file contains:

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

<Import>

<Row>

<PNALT>10000001</PNALT>

<NACHN>Nick</NACHN>

<VORNA>Fernand</VORNA>

<USRTY>Mail</USRTY>

<USRID>abc@asdf.de</USRID>

<USRTY>Tel</USRTY>

<USRTY>Fax</USRTY>

<USRID>0992 / 21-999</USRID>

</Row>

</Import>

The target output xml appears as mentioned hereunder:-

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

<EmployeeMsg>

<Records>

<Record>

<PersonnelNumber>10000001</PersonnelNumber>

<LastName>Fahrmehrsie</LastName>

<FirstName>Guntera</FirstName>

<CommunicationData>

<CommunicationType>Mail</CommunicationType>

</CommunicationData>

<CommunicationData>

<CommunicationType>Tel</CommunicationType>

<CommunicationIDNumber>abc@asdf.de</CommunicationIDNumber>

</CommunicationData>

<CommunicationData>

<CommunicationType>Fax</CommunicationType>

<CommunicationIDNumber>0993 / 21-999</CommunicationIDNumber>

</CommunicationData>

</Record>

</Records>

</EmployeeMsg>

I am getting a data mismatch in the target output. The mail id is coming under 'Tel'. How will I make the Mail Id to get it displayed under 'Mail'. I have set the <USERID> and <USRTY> to 0... Unbounded and <CommunicationType> and <CommuniationIDNumber> also to 0... Unbounded. I think I have gone wrong in the Mapping.

Can anyone suggest how to fix this issue. Thanks in advance.

Regards.

Praveen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Part of your target structure looks like :

<b><CommunicationData></b><CommunicationType>Mail</CommunicationType>

<b></CommunicationData></b>

<b><CommunicationData></b><CommunicationType>Tel</CommunicationType>

<CommunicationIDNumber>abc@asdf.de</CommunicationIDNumber>

<b></CommunicationData></b>

<b><CommunicationData></b><CommunicationType>Fax</CommunicationType>

<CommunicationIDNumber>0993 / 21-999</CommunicationIDNumber>

<b></CommunicationData></b>

This means that, for every occurence of <CommunicationType> and <CommunicationIDNumber> a <CommunicationData> tag is to be created.

You need to do the following:

<CommunicationType>-splitByValue-<TCommunicationType>

<CommunicationIDNumber>-splitByValue<TCommIDNumber>

<CommunicationData>-splitByValue<TCommData>

For every occurence of communicationType tag, you need a CommunicationID tag as a parent. Similarly, for communicationIDNumber. Hence, you need to do the above 3 steps.

Regards,

Smitha.

former_member8655
Active Participant
0 Kudos

Hi Praveen

Please check your mapping once again.

may be you have some mis match in mapping.

Regards

Mitesh

former_member192798
Active Contributor
0 Kudos

Hi Mitesh,

I have checked the mapping. It's correct but the output data is having a mismatch. It still displays the same way. Any suggestions.

Regards.

Praveen

moorthy
Active Contributor
0 Kudos

If you provide Source and Target Sturcture, then it is easy to look into that.

Because i am sure that , there small mistake in Mapping.

-Moorthy

former_member192798
Active Contributor
0 Kudos

Hi,

I hereunder mention the source and target structure:-

Source Structure

-


Import (ComplexType)

Row (Element, 0...unbounded)

PNALT (Element, xsd:string, 0...1)

NACHN (Element, xsd:string, 0...1)

VORNA (Element, xsd:string, 0...1)

USRTY (Element, xsd:string, 0...unbounded)

USRID (Element, xsd:string, 0...unbounded)

Target Structure

-


EmployeeMsg (ComplexType)

Records (0....1)

Record (1..unbounded)

PersonnelNumber (Element, xsd:string, 0...1)

LastName (Element, xsd:string, 0...1)

FirstName (Element, xsd:string, 0...1)

CommunicationData (Element, xsd:string, 0...unbounded)

CommunicationType ((Element, xsd:string, 0...unbounded)

CommunicationIDNumber (Element, xsd:string, 0...unbounded)

Mapping

-


EmptyConstant <-------> EmployeeMsg

Import <------> Records

Row <----


> Record

PNALT <----


> PersonnelNumber

NACHN <----


> LastName

VORNA <----


> FirstName

EmptyConstant <----


> CommunicationData

USRTY <----


> CommunicationType

USRID <----


> CommunicationIDNumber

I am getting a data mismatch in the xml output. The mail id is coming under 'Tel'. How will I make the Mail Id to get it displayed under 'Mail'. Kindly advice.

Thanks in advance.

Regards.

Praveen

moorthy
Active Contributor
0 Kudos

Hi Praveen,

If you use SplitByValue node funtion in the Mapping you will get required result.

USRTY <----SpluitByValue--> CommunicationType

USRID <---SplitByValue--> CommunicationIDNumber

Just check it. And one more thing, if you want to repeat the fields like (USRTY, USRID) , then it is better to create one wrapper sturcuture on these fields.

Like

DT (0..n)

USRTY

USRID

Hope this helps,

regards,

Moorthy

former_member192798
Active Contributor
0 Kudos

Hi Moorthy,

If I need to create a wrapper structure on the USRTY and USRID fields, will the source xml file structure comply with the Message Type. Because my source xml file is of following structure:

<Import>

<Row>

<Field1></Field1>

</Row>

</Import>

The source structure data type will be:

Import

Row

Field1

Comm

USRTY

USRID

So if I add a new data type structure to the existing one won't there be an error. Please clarify.

Regards.

Praveen

former_member192798
Active Contributor
0 Kudos

Hi Moorthy,

As suggested by you, I used SplitByValue node function and also created a wrapper structure. But I am unable to get the result.

Any workaround to fix this.

Regards.

Praveen