Skip to Content
avatar image
Former Member

Difference between maxOccurs>1 and maxOccurs = unbound

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Apr 08, 2008 at 10:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 08, 2008 at 10:41 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 08, 2008 at 10:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 08, 2008 at 11:00 AM

    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!!

    Add comment
    10|10000 characters needed characters exceeded