cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between maxOccurs>1 and maxOccurs = unbound

Former Member
0 Kudos

Guys,

What is the "Difference between maxOccurs>1 and maxOccurs = unbound" in any XML Schema? What I understand, both should be same. How the mapping behaves if any element has such restriction in target message?

Thanking you all in advance.

Accepted Solutions (1)

Accepted Solutions (1)

aashish_sinha
Active Contributor
0 Kudos

Hi,

0---Unbounded: 0 represents element either come or not come it is not mandatory.

1---Unbounded: 1 represents element value should come and it is mandatory.

Unbounded represnets the element value can reteate max times for example if Unbounded is replaces by 999 then that value will repeate 999 time or that value will come max of 999 times.

Sender side: 0 - Unbounded and 1 - unbounded doesn't make any difference it only says that you can send multiple records of this structure type.

Reciever Side: Yes it makes a difference as 0-unbounded is optional ,1-unbounded becomes mandatory , so you have to send at least one record other wise it will throw an error .

Regards

Aashish Sinha

PS : reward points if helpful

Answers (3)

Answers (3)

prasanthi_chavala
Active Contributor
0 Kudos

Hi,

If the occurance of the target node is maxOccurs > 1 then the target element is created as often as mapped source element occurs in the source messgae and the same applies for the element which as maxOccurs = Unbounded.There is no difference.

Thanks!!

Former Member
0 Kudos

Thanks for clearing the things.

One last thing, how would generating functions would behave under these two scenario? (By Generating functions I mean where there is no source field(s))

Former Member
0 Kudos

Another clarification is needed .....!!

As I under stand if the maxOccurs > 1, then it is mandatory.....right? However if maxOccurs = unbound, then whether it is mandatory or not, it depends on minOccurs. If the minOccurs = 0, it is not required and if minOccurs> 1, then it is mandatory.

If my above statement is true....then does that mean that for maxOccurs>1, there is no any significance of minOccurs to make it mandatory or not? It will always mandatory irrespective of minOccurs...right? The only thing minOccurs would contribute that how many target elements are created.

Am I correct?

Former Member
0 Kudos

Hey

>>As I under stand if the maxOccurs > 1, then it is mandatory.....right?

No,it doesn't mean that.

minOccurs define whether a field is mandatory of not,if minOccurs is 0 then its not mandatory if minOcuurs is 1 then its mandatory.

maxoccurs only tells how many times it can occur,it does not tell whether it has to occur or not.

Thanx

Aamir

Former Member
0 Kudos

Hi,

Then what is the differences among

1) maxOccurs=<n> (any fixed number)

2) maxOccurs > 1

3) maxOccurs = unbound

Thanks

Former Member
0 Kudos

Any closing comments ....thx?

Former Member
0 Kudos

Hi Rajan,

What is the "Difference between maxOccurs>1 and maxOccurs = unbound" in any XML Schema? - maxOccurs>1 means the node will exist at least once and may be more than one time.

maxOccurs = unbound means there is no restriction on the occurance of the node.

So in XML schema you have to see the minOccurs field value..........so if a field has minOccurs 0 and maxOccurs unbounded then the field is basically optional and can or can not exist in the data...........but a field having maxOccurs>1 means the field will occur at least once so in a way it becomes mandatory.

So in mapping the difference arises that you can leave a field with 0..unbounded as unmapped as it is optional but you have to map the field having maxOccurs>1 as it is mandatory.

Regards,

Rajeev Gupta

Former Member
0 Kudos

Hi,

>>What is the "Difference between maxOccurs>1 and maxOccurs = unbound"

Maxoccurs>1 means we can have the value for that fieeld max of one time

Maxoccurs-Unbounded means we can have unlimited values fror that field

Regards

Seshagiri