on 07-28-2010 12:28 PM
Hi All,
I am working on a message mapping.
I am getting the error as cannot produce target element.Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
Can you please help me?
Thanks in advance
Shwetha,
The Problem may lie in the instance you use.You may find no namespace in the payload or some sml header data may be missing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
did you check the namespaces of your test document. If they don't match your xsd, the mapping won't work either.
Best Regards
Sven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shweta,
Can you tell us about the source and target message structure of the mapping?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Shweta Kullkarni,
I assume your XSD is okay.
- But you should check wether if the element in your source file is empty or maybe does not exist!?
- Also, sometimes if you have wrong context elements are suppressed and then you do not get a target element.
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check if you have not missed to map any mandatory field (red color field) at target. Also do the mapping of parent nodes (if not done).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> I have mapped the root nodes and the occurrences of both the structures are same.
>
> But still I am getting the same error.
How you have fed your data in test tab... I guess your test data is not correct.
Expend the nodes & subnodes under test tab and check make sure there is no red nodes/fieds.
Execute your mapping without any test data and see if you get any errors.
I have mapped the root nodes and the occurrences of both the structures are same.
If the minimum occurence of the target node is 1 (mandatory) then you dont need to map it....it will be green (by default)
If you are still getting the error (even after mapping all the required/ mandatory fields) then recreate the mapping.
Regards,
Abhishek.
Hi Abhishek,
Thanks for the reply.
I have created the mapping again but it is still giving the same error.
The occurrence of the field in error is 1:1.
In the mapping there were a few fields ,no value was coming for, so I used the mapwith default function for that.Is it right?
Am I getting the error becaise of the fields for which no values are coming ?
The structure is like
RootNode(Externa Message)
--Node1 1:1
-
Subnode1 1:1
-
SubSubnode1 1:1
-
SubSubSubnode11:Unbounded
-
SubSubSubSubnode1 1:1
-
Fieldinerror 1:1
Can you please help me?
Thanks in advance
In the mapping there were a few fields ,no value was coming for, so I used the mapwith default function for that.Is it right?
The min occurence for your fields seem to be 1 .... so they should be mapped and you should ensure that if no source value is coming then either map to blank constant or mapWithDefault
Regards,
Abhishek.
In the mapping there were a few fields ,no value was coming for, so I used the mapwith default function for that.Is it right?
A) Is any mapping is made between those fields whose value is not coming from source is yes then use map with default function. if no mapping is there then use constant function which default value as per the requirement.
chirag
Hi Abhishek,
Thanks for the reply
The min occurence for your fields seem to be 1 .... so they should be mapped and you should ensure that if no source value is coming then either map to blank constant or mapWithDefault
I am mapping the target field with the source field means there is the source field available,but the value for the source field may not be available in the testing payload,so I mapped that source field with mapwithsedault and then mapwith default with the target field.
Can you please help me?
Thanks in advance
Hi Chirag,
Thanks for the reply.
I am mapping the target field with the source field means there is the source field available,but the value for the source field may not be available in the testing payload,so I mapped that source field with mapwithsedault and then mapwith default with the target field.
Thanks in advance
U have done correct- after this also r u getting the same error.
See if ur source field dont have any value coming then in target XML field tag will not be created at all hence in order to create that u use mapwithdefault value which will make sure that target XML field tag will be created with either default value
chirag.
I am mapping the target field with the source field means there is the source field available,
No.....this understanding is not correct.....even after mapping the source field the error can occur.
The source field should be present in the test data which is passed to the mapping....this restriction is for mandatory target fields.
but the value for the source field may not be available in the testing payload,so I mapped that source field with mapwithsedault and then mapwith default with the target field.
this is fine....are you still getting the error?
Regards,
Abhishek.
Hi Chirag,
Thanks for the reply.
See if ur source field dont have any value coming then in target XML field tag will not be created at all hence in order to create that u use mapwithdefault value which will make sure that target XML field tag will be created with either default value
I have used the mapwithdefault but still getting the error.Is it because the value is not coming for the source field?
If so,then it will always give an error whenever there is no value coming for the source field even after using the mapwith default.Is it?
Thanks in advance
Hi Abhishek,
The target field is mapped with any of the source fields depending on the condition.
There are values for a few source fields in the testing payload while there may not be any value for some of the source fields,
So I used the mapwithdefault and then mapped those source fields with the target fields.
Thanks in advance
So I used the mapwithdefault and then mapped those source fields with the target fields.
I am asking have you specified any default value which should be mapped when the source field is not coming? If input queue is empty (i.e. source not present) then the default value will be used.
The target field is mapped with any of the source fields depending on the condition.
What is the condition?
If the condition returns false then also you will get the error saying that target could not created.....mapWithDefault will also not work then.
Hi Abhishek,
Thanks for the reply.
So I used the mapwithdefault and then mapped those source fields with the target fields.
I am asking have you specified any default value which should be mapped when the source field is not coming? If input queue is empty (i.e. source not present) then the default value will be used.
I have mentioned the default value in the mapwithdefault but there is no value for the source field in the payload.Is it the reason for the error?
Thanks in advance
As per structure in External Definition, all the Node & subnodes have occurance 1: 1 or Unbounded.
It means that all the node & subnodes are mandatory, as minimum requirement is 1. Blank is not allowed in any node or subnode.
Also field has 1:1 occurance, it is also mandatory.
Check & pass the values in all the node & subnodes, also in fields have 1:1 occurance.
If you are not getting any value in source structure. Pass the constant value in the field.
Give IF condition, if Source Exists --> Pass Value.
Else --> Source Not Exists --> Pass Constant (SPACE).
Means,the error such as cannot creae target element can also occur?
A) No for that case u will not get this error. Ur error is because of missing root node mapping and occurance.
Check one by one root node mapping that is the best approach as u have many root node in ur structure.
Also U can use display queue function to verify the target output.
chirag
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
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.