on 06-20-2007 5:22 AM
Hi All:
I have two xsd one for source and one for target.
<b>source :</b>
Fname
Lname
Mname
Address (occurance 0..unbound)
-Street (1..1)
-City (1..1)
-PIN (1..1)
-Country (1..1)
<b>Target</b>
Name (1..1)
Address (1..1)
-Street (1..1)
-City (1..1)
-PIN (1..1)
-Country (1..1)
If Address array is coming in source xml that there in no problem in Mapping. But if source xml does not have address array then mapping will fail as the cardinality for the target is 1..1
Bottom line if souce xml does not have Address array, even address array has to be generated in target.
How can I achive it in Message Mapping?? Any how I have to generate one address array in the target even address array is not present in the source xml
<b>Thanks</b>
Farooq.
Farooq
You can use the standard Node function "exists" to check for the existence of the node and handle it accordingly using "If" standard Boolean function
regard
skrishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
As Bhavesh said,you need to use <b>mapWithDefault</b> function in mapping target node(Address) and elements(Street,City,PIN and Country)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All:
I achived this using If-else function.
like :
address--exist--address
else blank to --address.
It will generatre address element.(but not subelement)
then for every sub element of address
addressexist-map source street to target street
else map constant(blank) to target street.
it will generate street..same is applicable for other..like city, PIN etc
Thanks all for your response
Hi Farooq,
Use MAPWITHDEFAULT . It is same as using IFELSE function & EXISTS together.
Better to use mapwithdefault.
Regards,
SUmit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All:
I have to generate the Address array, and I cannot change the occurance from1..1 to 0..1
Also I already tried if-else funciton like :
Address -exist then map address else map constant(empty). But I got
only Address tag in output not the whole array.
out out is like this
Name
Address (no subelements).
bottom line I cannot change the xsd. but has to generate the Address array(with all sub field) on the target
Thanks
Regards.
Like pointed by Satish change occurrence to 0 to unbounded of the address field and then use MAPWITHDEFAULT.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mazhar,
Just change their occurence from 1.1 to 0.1. If you are writing a CSV file then if you change this then it should be fine.
If you are using fixed length file then in the mapping use an If-ELSE condition. If you have the field exists then pass the field else pass constant which is equal to the length of the field.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
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.