on 04-27-2006 4:45 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen
Please check your mapping once again.
may be you have some mis match in mapping.
Regards
Mitesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.