You are viewing the documentation for Blueriq 14. Documentation for other versions is available in our documentation directory.
Whom is this guide for?
People that are interested in a detailed description about how Blueriq handles XML messages based on XSD schemas
What is in this guide?
This guide lists the behavior of the Runtime when creating or parsing XML messages based on XSD schemas (SOAP and REST with schema sets).
The behavior is broken down by:
whether the message is being sent or being received
whether attributes and relations are inside a sequence or a choice
whether an element is mapped to an attribute or a relation
whether the attribute or relation is single-valued or multi-valued
1. Sending an XML message
1.1 Sequences
When generating XML sequences, the following general rules apply:
- a sequence is repeated at least as many times as indicated by the minOccurs on the sequence
- a sequence is repeated at most as many times as indicated by the maxOccurs on the sequence
- if a sequence cannot be repeated at least minOccurs times, an error is thrown
- if it is possible to repeat a sequence more than maxOccurs times, an error is thrown
When generating tags inside sequences mapped to attributes or relations, the following rules determine whether a tag is generated, the form of the tag:
- system-set unknowns never generate a tag
- user-set unknown attributes generate an empty or nil tag, depending on the nillable property
- unknown relations never generate a tag (whether they be user set or system set)
- known values always generate tag
When a tag cannot be generated as per the rules above, the following rules determine whether this is an error or not:
- if a tag cannot be generated and the tag minOccurs requires at least 1 tag to be generated, an error is thrown
The following rules apply for multi-valued attributes and relations:
- when an attribute or relation results in multiple tags (i.e. multi-valued attributes or relations), the number of generated tags must not exceed the maxOccurs on that tag, otherwise an error is thrown.
- when an attribute is multi-valued and does not have enough values to satisfy the minOccurs constraint, it is padded with empty or nil elements. Padding applies for attributes, as it doesn't result in extra values on the receiving side.
- when a relation is multi-valued and does not have enough values to satisfy the minOccurs constraint, an error is thrown. Padding does not apply for relations, as that results in extra instances on the receiving side.
Note:
- if
- a tag is inside a sequence with maxOccurs = n > 1 and
- the tag has maxOccurs = m > 0 and
- the attribute or relation has p > m values
- then
- an error is still thrown
- it is not possible to choose m values on the first repetition of the sequence and the remaining p - m values on the second repetition of the sequence
- when a tag mapped to an attribute or relation is expanded, all of its values are considered in one go and must conform to the minOccurs and maxOccurs constraints on that tag
1.1.1 Single-Valued Attributes
Value | Source | minOccurs | nillable | Result |
---|---|---|---|---|
unknown | system | 0 | * | element not present |
unknown | system | > 0 | * | error |
unknown | user | 0 | false | empty element |
unknown | user | 0 | true | nil element |
unknown | user | 1 | false | empty element |
unknown | user | 1 | true | nil element |
unknown | user | > 1 | false | as many empty elements as required by minOccurs |
unknown | user | > 1 | true | as many nil elements as required by minOccurs |
known | * | * | * | an element containing the value |
1.1.2 Multi-Valued Attributes
Value | Source | minOccurs | nillable | Result |
---|---|---|---|---|
unknown | system | 0 | * | no elements present |
unknown | system | > 0 | * | error |
unknown | user | 0 | false | empty element |
unknown | user | 0 | true | nil element |
unknown | user | > 0 | false | as many empty elements as required by minOccurs |
unknown | user | > 0 | true | as many nil elements as required by minOccurs |
known, count < minOccurs | * | * | false | count elements with values, padded with empty elements as required by minOccurs |
known, count < minOccurs | * | * | true | count elements with values, padded with nil elements as required by minOccurs |
known, minOccurs <= count <= maxOccurs | * | * | * | as many elements as there are values, each element containing the corresponding value |
known, maxOccurs < count | * | * | * | error |
1.1.3 Single-Valued Relations
The source of relations is not used when handing unknown relations. Empty or nil tags are never created for relations, as that would lead to extra, unwanted instances on the receiving side.
Value | minOccurs | nillable | Result |
---|---|---|---|
unknown | 0 | * | element not present |
unknown | > 0 | * | error |
known, attributes and relations do not generate sub-elements | * | false | empty element |
known, attributes and relations do not generate sub-elements | * | true | nil element |
known, at least one attribute or relation generates a sub-element | * | * | an element with sub-elements according to the rules on this page |
1.1.4 Multi-Valued Relations
Value | minOccurs | nillable | Result |
---|---|---|---|
unknown | 0 | * | no elements present |
unknown | > 0 | * | error |
known, count < minOccurs | * | * | error |
known, minOccurs <= count <= maxOccurs | * | false | count elements |
known, minOccurs <= count <= maxOccurs | * | true | count elements. If any of the instances do not generate sub-elements, the element corresponding to that instance is nil |
known, maxOccurs < count | * | * | error |
When a multi-valued relation is mapped directly to a sequence, the relation must have exactly as many values as indicated by the minOccurs and maxOccurs on the sequence. If there are too few values or too many, an error is thrown.
1.2 Choices
The behaviour of choices depends on the min/maxOccurs on the choice, the min/maxOccurs of the elements inside the choice, as well as the value and source of the attributes or relations mapped to those elements.
It is possible to choose multiple times, as required by minOccurs and restricted by maxOccurs on the choice. When choosing a second time, the same element that was chosen on the first choice cannot be chosen again, unless it has minOccurs = 0.
The following rules apply when generating an XML choice:
- at last as many choices are made as indicated by the minOccurs on the choice
- at most as many choices are made as indicated by the maxOccurs on the choice
- once an element has been chosen, it cannot be chosen again, unless it has minOccurs = 0
- if a choice must be made and it's not possible to choose anything, an error is thrown
- if the maximum number of choices has been made and there are other elements that could be chosen, an error is thrown
The following rules determine whether an element mapped to an attribute or relation is chosen:
- system-set unknown is never chosen
- user-set unknown attributes are chosen and generate an empty or nil tag, depending on the nillable property
- unknown relations are never chosen (regardless of whether they are user set or system set)
- known values are always chosen
- if an element has already been chosen, it cannot be chosen again unless it has minOccurs = 0 and the attribute is system-set unknown or the relation is unknown (system or uset set)
- this rule effectively means that if there aren't enough values to fill a choice with minOccurs > 1 and there are elements with minOccurs = 0 that map to unknowns which do not generate elements (i.e. system-set unknown for attributes, all unknowns for relations), then we consider that we've chosen these elements "zero" times instead of throwing an error
The following rules apply for multi-valued attributes and relations:
- when an attribute or relation results in multiple tags (i.e. multi-valued attributes or relations), the number of generated tags must not exceed the maxOccurs on that tag, otherwise an error is thrown.
- when an attribute is multi-valued and does not have enough values to satisfy the minOccurs constraint, it is padded with empty or nil elements. Padding applies for attributes, as it doesn't result in extra values on the receiving side.
- when a relation is multi-valued and does not have enough values to satisfy the minOccurs constraint, an error is thrown. Padding does not apply for relations, as that results in extra instances on the receiving side.
1.2.1 Single-Valued Attributes
The following table illustrates the Runtime behaviour assuming there is a choice in the XSD which has two elements inside it: element A and element B. The table headings have the following meaning:
- Choice min = the value of minOccurs on the choice itself
- Element A/B Value = the value of the attribute mapped to element A/B
- Element A/B Source = the source of the value of the attribute mapped to element A/B (system indicates the value was derived by the Rule Engine, user indicates the value was set manually via user interaction, service call, etc)
- Element A/B min = the value of minOccurs on element A/B in the XSD
- Element A/B nill = the value of the nillable attribute on element A/B in the XSD
Choice min | Element A | Element B | Result | Explanation | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Value | Source | min | nill | Value | Source | min | nill | |||
0 | unknown | system | * | * | unknown | system | * | * | no element is present | chosen 0 times, or chosen element A 0 times, or chosen element B 0 times |
0 | unknown | system | * | * | unknown | user | 0 | false | <B/> | chosen element B 1 time |
0 | unknown | system | * | * | unknown | user | 0 | true | <B xsi:nil="true"/> | chosen element B 1 time |
0 | unknown | system | * | * | unknown | user | 1 | false | <B/> | chosen element B 1 time |
0 | unknown | system | * | * | unknown | user | 1 | true | <B xsi:nil="true"/> | chosen element B 1 time |
0 | unknown | system | * | * | unknown | user | > 1 | false | <B /> <B/> | chosen as many empty B elements as required by element B minOccurs, chosen 1 time |
0 | unknown | system | * | * | unknown | user | > 1 | true | <B xsi:nil="true"/> <B xsi:nil="true"/> | chosen as many nil B elements as required by element B minOccurs, chosen 1 time |
0 | unknown | system | * | * | known | <= 1 | * | * | <B>value</B> | |
0 | unknown | system | * | * | known | > 1 | * | false | <B>value</B> <B/> | chosen 1 B element and padded with as many empty elements as required by minOccurs of element B, chosen 1 time |
0 | unknown | system | * | * | known | > 1 | * | true | <B>value</B> <B xsi:nil="true"/> | chosen 1 B element and padded with as many nil elements as required by minOccurs of element B, chosen 1 time |
0 | unknown | user | 0 | false | unknown | system | * | * | <A> | chosen element A 1 time |
0 | unknown | user | 0 | true | unknown | system | * | * | <A xsi:nil="true"/> | chosen element A 1 time |
0 | unknown | user | 1 | false | unknown | system | * | * | <A> | chosen element A 1 time |
0 | unknown | user | 1 | true | unknown | system | * | * | <A xsi:nil="true"/> | chosen element A 1 time |
0 | unknown | user | > 1 | false | unknown | system | * | * | <A>value</A> <A/> | chosen 1 A element and padded with as many empty elements as required by minOccurs of element A, chosen 1 time |
0 | unknown | user | > 1 | true | unknown | system | * | * | <A>value</A> <A xsi:nil="true"/> | chosen 1 A element and padded with as many nil elements as required by minOccurs of element A, chosen 1 time |
0 | unknown | user | * | * | unknown | user | * | * | error | |
0 | unknown | user | * | * | known | * | * | * | error | |
0 | known | * | * | * | unknown | system | * | * | <A>value</A> | chosen 1 A element 1 time |
0 | known | * | * | * | unknown | user | * | * | error | |
0 | known | * | * | * | known | * | * | * | error | |
1 | unknown | system | 0 | * | unknown | system | 0 | * | no element is present | chosen element A 0 times, or chosen element B 0 times |
1 | unknown | system | 0 | * | unknown | system | > 0 | * | no element is present | chosen element A 0 times |
1 | unknown | system | 0 | * | unknown | user | <= 1 | false | <B /> | chosen element B 1 time |
1 | unknown | system | 0 | * | unknown | user | <= 1 | true | <B xsi:nil="true"/> | chosen element B 1 time |
1 | unknown | system | 0 | * | unknown | user | > 1 | false | <B/> <B/> | chosen element B 1 time, padded with as many empty elements as required by minOccurs of element B |
1 | unknown | system | 0 | * | unknown | user | > 1 | true | <B xsi:nil="true" /> <B xsi:nil="true" /> | chosen element B 1 time, padded with as many nil elements as required by minOccurs of element B |
1 | unknown | system | 0 | * | known | * | <= 1 | * | <B>value</B> | chosen element B 1 time |
1 | unknown | system | 0 | * | known | * | > 1 | false | <B>value</B> <B /> | chosen element B 1 time, padded with as many empty elements as required by minOccurs of element B |
1 | unknown | system | 0 | * | known | * | > 1 | true | <B>value</B> <B xsi:nil="true" /> | chosen element B 1 time, padded with as many nil element as required by minOccurs of element B |
1 | unknown | system | > 0 | * | unknown | system | 0 | * | no element is present | chosen element B 0 times |
1 | unknown | system | > 0 | * | unknown | system | > 0 | * | error | no element could be chosen |
1 | unknown | system | > 0 | * | unknown | user | <= 1 | false | <B/> | chosen element B 1 time |
1 | unknown | system | > 0 | * | unknown | user | <= 1 | true | <B xsi:nil="true"/> | chosen element B 1 time |
1 | unknown | system | > 0 | * | unknown | user | > 1 | false | <B /> <B /> | chosen element B 1 time, padded with as many empty elements as required by minOccurs of element B |
1 | unknown | system | > 0 | * | unknown | user | > 1 | true | <B xsi:nil="true" /> <B xsi:nil="true" /> | chosen element B 1 time, padded with as many empty elements as required by minOccurs of element B |
1 | unknown | system | > 0 | * | known | * | <= 1 | * | <B>value</B> | chosen element B 1 time |
1 | unknown | system | > 0 | * | known | * | > 1 | false | <B>value<B> <B /> | chosen element B 1 time, padded with as many empty elements as required by minOccurs of element B |
1 | unknown | system | > 0 | * | known | * | > 1 | true | <B>value</B> <B xsi:nil="true"/> | chosen element B 1 time, padded with as many nil elements as required by minOccurs of element B |
1 | unknown | user | <= 1 | false | unknown | system | * | * | <A/> | chosen element A 1 time |
1 | unknown | user | <= 1 | true | unknown | system | * | * | <A xsi:nil="true" /> | chosen element A 1 time |
1 | unknown | user | > 1 | false | unknown | system | * | * | <A/> <A/> | chosen element A 1 time, padded with as many empty elements as required by minOccurs of element A |
1 | unknown | user | > 1 | true | unknown | system | * | * | <A xsi:nil="true" /> <A xsi:nil="true" /> | chosen element A 1 time, padded with as many nil elements as required by minOccurs of element A |
1 | unknown | user | * | * | unknown | user | * | * | error | |
1 | unknown | user | * | * | known | * | * | * | error | |
1 | known | * | <= 1 | * | unknown | system | * | * | <A>value</A> | |
1 | known | * | > 1 | false | unknown | system | * | * | <A>value</A> <A/> | chosen element A 1 time, padded with as many empty elements as required by minOccurs of element A |
1 | known | * | > 1 | true | unknown | system | * | * | <A>value</A> <A xsi:nil="true" /> | chosen element A 1 time, padded with as many nil elements as required by minOccurs of element A |
1 | known | * | * | * | unknown | user | * | * | error | |
1 | known | * | * | * | known | * | * | * | error | |
> 1 | unknown | system | 0 | * | unknown | system | 0 | * | no element present | Chosen as many times as required by minOccurs of choice. At each choice, either element A was chosen 0 times, or element B was chosen 0 times |
> 1 | unknown | system | 0 | * | unknown | system | > 1 | * | no element present | Chosen as many times as required by minOccurs of choice. At each choice, element A was chosen 0 times |
> 1 | unknown | system | 0 | * | unknown | user | <= 1 | * | <B> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen 1 time. On the remaining choices, element A was chosen 0 times. |
> 1 | unknown | system | 0 | * | unknown | user | > 1 | false | <B> <B> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen as many times as required by minOccurs of element B. On the remaining choices, element A was chosen 0 times |
> 1 | unknown | system | 0 | * | unknown | user | > 1 | true | <B xsi:nil="true" /> <B xsi:nil="true" /> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen as many times as required by minOccurs of element B. On the remaining choices, element A was chosen 0 times |
> 1 | unknown | system | 0 | * | known | * | <= 1 | * | <B>value</B> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen. On the remaining choices, element A was chosen 0 times |
> 1 | unknown | system | 0 | * | known | * | > 1 | false | <B>value</B> <B/> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen, padded with as many empty elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | unknown | system | 0 | * | known | * | > 1 | true | <B>value</B> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen, padded with as many nill elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | unknown | system | > 0 | * | unknown | system | 0 | * | no element present | Chosen as many times as required by minOccurs of choice. On each choice, element B was chosen 0 times |
> 1 | unknown | system | > 0 | * | unknown | system | > 0 | * | error | no element could be chosen |
> 1 | unknown | system | > 0 | * | unknown | user | 0 | false | <B> | Chosen as many times as required by minOccurs of choice On the first choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | unknown | system | > 0 | * | unknown | user | 0 | true | <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element B was chosen 1 time. On the remaining choices, element B was chosen 0 times. |
> 1 | unknown | system | > 0 | * | unknown | user | > 0 | * | error | Chosen as many times as required by minOccurs of choice On the first choice, element B was chosen as many times as required by minOccurs of element B On the remaining choices, no other element could be chosen |
> 1 | unknown | system | > 0 | * | known | * | 0 | * | <B>value</B> | Chosen as many times as required by minOccurs of choice. On the first choice, element B was chosen 1 time. On the remaining choices, element B was chosen 0 times |
> 1 | unknown | system | > 0 | * | known | * | > 0 | * | error | Chosen as many times as required by minOccurs of choice On the first choice, element B was chosen as many times as required by minOccurs of element B On the remaining choices, no other element could be chosen |
> 1 | unknown | user | 0 | false | unknown | system | 0 | * | <A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | false | unknown | system | > 0 | * | <A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the remaining choices, element A was chosen 0 times |
> 1 | unknown | user | 0 | false | unknown | user | <= 1 | false | <A> <B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | false | unknown | user | <= 1 | true | <A> <B xsi:nil="true" /> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | false | unknown | user | > 1 | false | <A> <B> <B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen as many times as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | unknown | user | 0 | false | unknown | user | > 1 | true | <A> <B xsi:nil="true"/> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen as many times as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | unknown | user | 0 | false | known | * | <= 1 | * | <A> <B>value</A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen as many times as required by minOccurs of element B On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | false | known | * | > 1 | false | <A> <B>value</B> <B/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen, padded with empty elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | false | known | * | > 1 | true | <A> <B>value</B> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen, padded with nil elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | true | unknown | system | 0 | * | <A xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | true | unknown | system | > 0 | * | <A xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the remaining choices, element A was chosen 0 times |
> 1 | unknown | user | 0 | true | unknown | user | <= 1 | false | <A xsi:nil="true"> <B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | true | unknown | user | <= 1 | true | <A xsi:nil="true"/> <B xsi:nil="true" /> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | true | unknown | user | > 1 | false | <A xsi:nil="true"/> <B> <B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen as many times as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | unknown | user | 0 | true | unknown | user | > 1 | true | <A xsi:nil="true"/> <B xsi:nil="true"/> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen as many times as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | unknown | user | 0 | true | known | * | <= 1 | * | <A xsi:nil="true"/> <B>value</A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen as many times as required by minOccurs of element B On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | true | known | * | > 1 | false | <A xsi:nil="true"/> <B>value</B> <B/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen, padded with empty elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | 0 | true | known | * | > 1 | true | <A xsi:nil="true"/> <B>value</B> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice element B was chosen, padded with nil elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | unknown | user | > 0 | false | unknown | system | 0 | * | <A/> <A/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the remaining choices, element B was chosen 0 times |
> 1 | unknown | user | > 0 | false | unknown | system | > 0 | * | error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen as many times as required by minOccurs of element A On the remaining choices, no other element could be chosen |
> 1 | unknown | user | > 0 | false | unknown | user | 0 | * | <A/> <A/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the remaining choices, element B was chosen 0 times |
> 1 | unknown | user | > 0 | false | unknown | user | > 0 | false | <A/> <A/> <B/> <B/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B If choice minOccurs > 2, then it is an error, as there is no 3rd element that could be chosen |
> 1 | unknown | user | > 0 | false | unknown | user | > 0 | true | <A/> <A/> <B xsi:nil="true"/> <B xsi:nil="true"/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B If choice minOccurs > 2, then it is an error, as there is no 3rd element that could be chosen |
> 1 | unknown | user | > 0 | false | known | * | 0 | * | <A/> <A/> <B>value</B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | unknown | user | > 0 | false | known | * | > 0 | false | <A/> <A/> <B>value</B> <B/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B If choice minOccurs > 2, then it is an error, as there is no 3rd element that could be chosen |
> 1 | unknown | user | > 0 | false | known | * | > 0 | true | <A/> <A/> <B>value</B> <B xsi:nil="true"/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B If choice minOccurs > 2, then it is an error, as there is no 3rd element that could be chosen |
> 1 | known | * | 0 | * | unknown | system | 0 | * | <A>value</A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | known | * | 0 | * | unknown | system | > 0 | * | <A>value</A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the remaining choices, element A was chosen 0 times |
> 1 | known | * | 0 | * | known | * | 0 | * | <A>value</A> <B>value</A> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice, element B was chosen 1 time On the remaining choices, element A was chosen 0 times or element B was chosen 0 times |
> 1 | known | * | 0 | * | known | * | > 0 | false | <A>value</A> <B>value</B> <B/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | known | * | 0 | * | known | * | > 0 | true | <A>value</A> <B>value</B> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen 1 time On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B On the remaining choices, element A was chosen 0 times |
> 1 | known | * | > 0 | false | unknown | system | 0 | * | <A>value</A> <A/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty element as required by minOccurs of element A On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | false | unknown | system | > 0 | * | error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty element as required by minOccurs of element A On the remaining choices, no other element could be chosen |
> 1 | known | * | > 0 | false | unknown | user | 0 | false | <A>value</A> <A/> <B/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | false | unknown | user | 0 | true | <A>value</A> <A/> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | false | unknown | user | > 0 | false | <A>value</A> <A/> <B/> <B/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | false | unknown | user | > 0 | true | <A>value</A> <A/> <B xsi:nil="true"/> <B xsi:nil="true"/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | false | known | * | 0 | * | <A>value</A> <A/> <B>value</B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | false | known | * | > 0 | false | <A>value</A> <A/> <B>value</B> <B/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | false | known | * | > 0 | true | <A>value</A> <A/> <B>value</B> <B xsi:nil="true"/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with empty elements as required by minOccurs of element A On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | true | unknown | system | 0 | * | <A>value</A> <A xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | true | unknown | system | > 0 | * | error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the remaining choices, no other element could be chosen |
> 1 | known | * | > 0 | true | unknown | user | 0 | false | <A>value</A> <A xsi:nil="true"/> <B/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | true | unknown | user | 0 | true | <A>value</A> <A xsi:nil="true"/> <B xsi:nil="true"/> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | true | unknown | user | > 0 | false | <A>value</A> <A xsi:nil="true"/> <B/> <B/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | true | unknown | user | > 0 | true | <A>value</A> <A xsi:nil="true"/> <B xsi:nil="true"/> <B xsi:nil="true"/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | true | known | * | 0 | * | <A>value</A> <A xsi:nil="true"/> <B>value</B> | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen 1 time On the remaining choices, element B was chosen 0 times |
> 1 | known | * | > 0 | true | known | * | > 0 | false | <A>value</A> <A xsi:nil="true"/> <B>value</B> <B/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen, padded with empty elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
> 1 | known | * | > 0 | true | known | * | > 0 | true | <A>value</A> <A xsi:nil="true"/> <B>value</B> <B xsi:nil="true"/> or error | Chosen as many times as required by minOccurs of choice On the first choice, element A was chosen, padded with nil elements as required by minOccurs of element A On the second choice, element B was chosen, padded with nil elements as required by minOccurs of element B If choice minOccurs > 2, then error as no 3rd element could be chosen |
1.2.2 Multi-Valued Attributes
The same general rules apply for multi-valued attributes as for single-valued attributes. In addition, there can be situations where the attribute is known and the value count is :
- too low to satisfy the minOccurs requirement
- too high to satisfy the maxOccurs requirement
The following table summarizes the Runtime behaviour for a multi-valued attribute with a known value.
Value Count | nillable | Result | Explanation |
---|---|---|---|
count < minOccurs | false | <A>value 1</A> <A>value 2</A> <A/> | count elements with values, padded with empty elements as required by minOccurs |
count < minOccurs | true | <A>value 1</A> <A>value 2</A> <A xsi:nil="true"/> | count elements with values, padded with nil elements as required by minOccurs |
minOccurs <= count <= maxOccurs | * | <A>value 1</A> <A>value 2</A> | as many elements as there are values, each element containing the corresponding value |
maxOccurs < count | * | error | When a choice is made and the multi-valued attribute is chosen, all values of that attribute are chosen and must satisfy the maxOccurs requirement. If the choice has maxOccurs > 1, it is not possible to choose some of the values of the attribute on the first choice and the remaining values in another choice. |
1.2.3 Single-Valued Relations
Unknown relations are never chosen, as that would result in extra instances created on the receiving side.
Padding with empty or nil tags to satisfy minOccurs requirements does not apply, as that also would result in extra instances created on the receiving side.
Choice minOccurs | Choice maxOccurs | Element A | Element B | Result | Explanation | ||
---|---|---|---|---|---|---|---|
Value | minOccurs | Value | minOccurs | ||||
0 | * | unknown | * | unknown | * | no element present | chosen 0 times |
0 | * | unknown | * | known | <= 1 | <B> ... </B> | chosen element B 1 time |
0 | * | unknown | * | known | > 1 | error | chosen element B 1 time, but could not satisfy minOccurs requirement of element B |
0 | * | known | <= 1 | unknown | * | <A>...</A> | chosen element A 1 time |
0 | <= 1 | known | <= 1 | known | <= 1 | error | chosen element A 1 time and element B 1 time, but choice maxOccurs does not allow making 2 choices |
0 | > 1 | known | <= 1 | known | <= 1 | <A>...</A> <B>...</B> | chosen element A 1 time and element B 1 time |
0 | * | known | <= 1 | known | > 1 | error | chosen element A 1 time and element B 1 time, but could not satisfy minOccurs requirement of element B |
0 | * | known | > 1 | * | * | error | chosen element A 1 time, but could not satisfy minOccurs requirement of element A |
1 | * | unknown | 0 | unknown | 0 | no element present | chosen element A 0 times or chosen element B 0 times |
1 | * | unknown | 0 | unknown | > 0 | no element present | chosen element A 0 times |
1 | * | unknown | 0 | known | <= 1 | <B>...</B> | chosen element B 1 time |
1 | * | unknown | 0 | known | > 1 | error | chosen element B 1 time, but could not satisfy minOccurs requirement of element B |
1 | * | unknown | > 0 | unknown | 0 | no element present | chosen element B 0 times |
1 | * | unknown | > 0 | unknown | > 0 | error | no element could be chosen |
1 | * | unknown | > 0 | known | <= 1 | <B>...</B> | chosen element B 1 time |
1 | * | unknown | > 0 | known | > 1 | error | chosen element B 1 time, but could not satisfy minOccurs requirement of element B |
1 | * | known | <= 1 | unknown | * | <A>...</A> | chosen element A 1 time |
1 | <= 1 | known | <= 1 | known | <= 1 | error | chosen element A 1 time and element B 1 time, but choice maxOccurs does not allow making 2 choices |
1 | > 1 | known | <= 1 | known | <= 1 | <A>...</A> <B>...</B> | chosen element A 1 time and element B 1 time |
1 | * | known | <= 1 | known | > 1 | error | chosen element A 1 time and element B 1 time, but could not satisfy minOccurs requirement of element B |
1 | * | known | > 1 | * | * | error | chosen element A 1 time, but could not satisfy minOccurs requirement of element A |
2 | * | unknown | 0 | unknown | 0 | no element present | chosen element A 0 times and element B 0 times |
2 | * | unknown | 0 | unknown | > 0 | error | chosen element A 0 times on the first choice, but no other element could be chosen on the second choice |
2 | * | unknown | 0 | known | <= 1 | <B>...</B> | chosen element A 0 times and element B 1 time |
2 | * | unknown | 0 | known | > 1 | error | chosen element A 0 times and element B 1 time, but could not satisfy minOccurs requirement of element B |
2 | * | unknown | > 0 | unknown | 0 | error | chosen element B 0 times on the first choice, but no other element could be chosen on the second choice |
2 | * | unknown | > 0 | unknown | > 0 | error | no element could be chosen |
2 | * | unknown | > 0 | known | <= 1 | error | chosen element B 1 times on the first choice, but no other element could be chosen on the second choice |
2 | * | unknown | > 0 | known | > 1 | error | chosen element B 1 times on the first choice, but could not satisfy minOccurs requirement of element B |
2 | * | known | <= 1 | unknown | 0 | <A>...</A> | chosen element A 1 times on the first choice, and chosen element B 0 times on the second choice |
2 | * | known | <= 1 | unknown | > 0 | error | chosen element A 1 times on the first choice, but no other element could be chosen on the second choice |
2 | * | known | <= 1 | known | <= 1 | <A>...</A> <B>...</B> | chosen element A 1 times on the first choice, and chosen element B 1 times on the second choice |
2 | * | known | <= 1 | known | > 1 | error | chosen element A 1 times on the first choice and chosen element B 1 times on the second choice, but could not satisfy minOccurs requirement of element B |
2 | * | known | > 1 | * | * | error | chosen element A 1 times on the first choice, but could not satisfy minOccurs requirement of element A |
> 2 | * | * | * | * | * | error | There must be at least as many elements in the choice as the choice minOccurs. The number of elements that can be chosen must not exceed choice maxOccurs. |
The <A>...</A> results in the table above can be further described as depending on:
- whether element A is nillable or not
- whether any of the attributes or relations of the instance mapped to element A generate sub-elements
# | Nillable | Sub-Elements | Result | Explanation |
---|---|---|---|---|
1 | false | false | <A/> | |
2 | false | true | <A> <Sub>...</Sub> <A> | The way in which the sub-elements are expanded depends on
All the rules described on this page apply recursively to sub-elements. |
3 | true | false | <A xsi:nil="true"/> | Instead of expanding empty or nil sub-elements, the message is made smaller by setting the A element to nil. Note that if in the XSD there are sub-elements which have minOccurs > 0 then no error is thrown, as xsi:nil="true" overrides those requirements, as described in the XSD Specification |
4 | true | true | <A> <Sub>...</Sub> </A> | The explanation for #2 applies for #4 as well. |
1.2.4 Multi-Valued Relations
The same rules apply for mulit-valued relations within a choice as for single-valued relations within a choice, as described in chapter 1.2.3. In addition, there can be situations where multi-valued relations:
- do not have enough values to satisfy the minOccurs requirement of the element
- have too many values to satisfy the maxOccurs requirement of the element
The behaviour of multi-valued relations in choices is similar to that of multi-valued attributes in choices (described in chapter 1.2.2), except that no padding with empty or nil tags is done in order to automatically satisfy the minOccurs requirement. In contrast with multi-valued attributes in choices, for multi-valued relations in choices an error will occur if the relation doesn't have enough values.
The following table summarizes the Runtime behaviour for a multi-valued relations with a known value.
Value Count | Result | Explanation |
---|---|---|
count < minOccurs | error | cannot satisfy the minOccurs requirement and no padding with empty or nill elements can be done |
minOccurs <= count <= maxOccurs | <A>...</A> <A>...</A> | as many elements as there are values, each element containing the corresponding value |
maxOccurs < count | error | When a choice is made and the multi-valued relation is chosen, all values of that relation are chosen and must satisfy the maxOccurs requirement. If the choice has maxOccurs > 1, it is not possible to choose some of the values of the relation on the first choice and the remaining values in another choice. |
When a multi-valued relation is mapped directly to a choice, the relation must have exactly as many values as indicated by the minOccurs and maxOccurs on the choice. If there are too few values or too many, an error is thrown.
2. Receiving an XML message
2.1 Sequences
When receiving XML sequences, they must conform to the XSD in regards of what elements are possible, the number of each element as constrained by minOccurs and maxOccurs on those elements and whether they are nillable.
A sequence is repeated at least as many times as indicated by the minOccurs on the sequence. If it is not possible to repeat the sequence the required number of times, an error is thrown.
A sequence is repeated at most as many times as indicated by the maxOccurs on the sequence. If it's possible to repeat the sequence more than maxOccurs times, an error is thrown.
The following rules apply for empty or nil tags:
- for attributes, an empty or nil tag results in a user-set unknown value
- for relations, an empty or nil tag results in an instance which set as the relation value
- all attributes and relations of this instance are system-set unknown
- for relations, an empty tag may result in error, depending on the constraints of the sub-elements of that relation
- for relations, a nil tag will never result in an error, regardless of the constraints of the sub-elements (these are ignored)
2.1.1 Single-Valued Attributes
XML Element | XSD | Result (Profile) | Explanation | ||||
---|---|---|---|---|---|---|---|
present | nil | empty | minOccurs | nillable | Value | Source | |
false | N/A | N/A | 0 | * | unknown | system | |
false | N/A | N/A | > 0 | * | error | XML not conform the XSD due to minOccurs | |
true | false | false | <=1 | * | known | user | |
true | false | false | > 1 | * | error | XML not conform the XSD due to minOccurs | |
true | false | true | <=1 | * | unknown | user | |
true | false | true | > 1 | * | error | XML not conform the XSD due to minOccurs | |
true | true | false | 0 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | false | 0 | true | unknown | user | The content is ignored. |
true | true | false | 1 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | false | 1 | true | unknown | user | The content is ignored |
true | true | false | > 1 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | false | > 1 | true | error | XML not conform the XSD due to minOccurs | |
true | true | true | 0 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | true | 0 | true | unknown | user | |
true | true | true | 1 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | true | 1 | true | unknown | user | |
true | true | true | > 1 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | true | > 1 | true | error | XML not conform the XSD due to minOccurs |
Note:
- when an element is mapped to a single-valued attribute and has minOccurs > 1 in the XSD and the element is present multiple times in the XML, the attribute will have the value of the last element from top to bottom (the value of each element is mapped in turn, later values overwrite prior values)
2.1.2 Multi-Valued Attributes
The same rules apply to multi-valued attributes in a sequence as for single-valued attributes in a sequences (chapter 2.1.1). In addition, there can be situations where the number of XML elements is too high to satisfy the maxOccurs requirements. In this situation an error occurs.
2.1.3 Single-Valued Relations
XML Element | XSD | Result (Profile) | Explanation | |||
---|---|---|---|---|---|---|
present | nil | minOccurs | nillable | Value | Source | |
false | N/A | 0 | * | unknown | system | |
false | N/A | > 0 | * | error | XML not conform the XSD | |
true | false | <= 1 | * | known | user | |
true | false | > 1 | * | error | XML not conform the XSD | |
true | true | <= 1 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | <= 1 | true | unknown | user | |
true | true | > 1 | false | error | XML not conform the XSD, element cannot have xsi:nil because element is not nillable | |
true | true | > 1 | true | error | XML not conform the XSD |
2.1.4 Multi-Valued Relations
The same rules apply for mulit-valued relations in a sequence as for single-valued relations in a sequence (chapter 2.1.3). In addition, there can be situations where the number of XML elements exceeds the maxOccurs value from the XSD. In this situation an error occurs.
When a multi-valued relation is mapped directly to a sequence, at least as many repetitions of the sequence must be present as indicated by the minOccurs and maxOccurs on the sequence. If there are too few or too many elements, an error is thrown.
2.2 Choices
When receiving XML choices, the following rules apply:
- the choice is repeated at last as many times as indicated by the minOccurs on the choice
- the choise is repeated at most as many times as indicated by the maxOccurs on the choice
- on each repetition of the choice one element is chosen (see below the rules which determine whether an element is chosen)
- if not enough elements could be chosen as required by the minOccurs on the choice, an error is thrown
- if too many elements could be chosen as required by the maxOccurs on the choice, an error is thrown
The following rules apply when choosing an element (as defined in the XSD, not in the received XML):
- an element can be chosen a single time; if the choice repeates due to minOccurs on the choice, the same element cannot be chosen again
- if an element has minOccurs > 0 and there are no other choices that could be made, an error is thrown
- empty or nil tags mapped to attributes result in user-set unknown values
- empty or nil tags mapped to relations result in an instance which is set in the relation
- all attributes and relations of this instance are system-set unknown
- when the tag is empty, an error could be thrown, depending on the constraints on the sub-elements (rules on this page applied recursively to sub-elements)
- when the tag is nil, an error is never thrown; constraints on sub-elements are ignored
2.2.1 Single-Valued Attributes
Ch. min | Ch. max | Element A | Element B | Result (Profile) | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
XML | XSD | XML | XSD | Attribute A | Attribute B | ||||||||||
present | nil | empty | min | nill | present | nil | empty | min | nill | Value | Source | Value | Source | ||
0 | * | false | N/A | N/A | 0 | * | false | N/A | N/A | * | * | unknown | system | unknown | system |
>0 | * | false | N/A | N/A | 0 | * | false | N/A | N/A | * | * | error | |||
<=1 | * | false | N/A | N/A | 0 | * | true | false | false | <=1 | * | unknown | system | known | user |
<=1 | * | false | N/A | N/A | 0 | * | true | false | false | >1 | * | error | |||
<=1 | * | false | N/A | N/A | 0 | * | true | false | true | <=1 | * | unknown | system | unknown | user |
<=1 | * | false | N/A | N/A | 0 | * | true | false | true | >1 | * | error | |||
<=1 | * | false | N/A | N/A | 0 | * | true | true | false | <=1 | false | error | |||
<=1 | * | false | N/A | N/A | 0 | * | true | true | false | <=1 | true | unknown | system | unknown | user |
<=1 | * | false | N/A | N/A | 0 | * | true | true | false | >1 | * | error | |||
<=1 | * | false | N/A | N/A | 0 | * | true | true | true | <=1 | false | error | |||
<=1 | * | false | N/A | N/A | 0 | * | true | true | true | <=1 | true | unknown | system | unknown | user |
<=1 | * | false | N/A | N/A | 0 | * | true | true | true | >1 | * | error | |||
<=1 | * | false | N/A | N/A | >0 | * | false | N/A | N/A | * | * | unknown | system | unknown | system |
<=1 | * | false | N/A | N/A | >0 | * | true | false | false | <=1 | * | unknown | system | known | user |
<=1 | * | false | N/A | N/A | >0 | * | true | false | false | >1 | * | error | |||
<=1 | * | false | N/A | N/A | >0 | * | true | false | true | <=1 | * | unknown | system | unknown | user |
<=1 | * | false | N/A | N/A | >0 | * | true | false | true | >1 | * | error | |||
<=1 | * | false | N/A | N/A | >0 | * | true | true | false | <=1 | false | error | |||
<=1 | * | false | N/A | N/A | >0 | * | true | true | false | <=1 | true | unknown | system | unknown | user |
<=1 | * | false | N/A | N/A | >0 | * | true | true | false | >1 | * | error | |||
<=1 | * | false | N/A | N/A | >0 | * | true | true | true | <=1 | false | error | |||
<=1 | * | false | N/A | N/A | >0 | * | true | true | true | <=1 | true | unknown | system | unknown | user |
<=1 | * | false | N/A | N/A | >0 | * | true | true | true | >1 | false | error | |||
<=1 | * | false | N/A | N/A | >0 | * | true | true | true | >1 | true | error | |||
<=1 | * | true | false | false | <=1 | * | false | N/A | N/A | * | * | known | user | unknown | system |
<=1 | <=1 | true | * | * | * | * | true | * | * | * | * | error | |||
<=1 | >1 | true | false | false | <=1 | * | true | false | false | <=1 | * | known | user | known | user |
<=1 | >1 | true | false | false | <=1 | * | true | false | false | >1 | * | error | |||
<=1 | >1 | true | false | false | <=1 | * | true | false | true | <=1 | * | known | user | unknown | user |
<=1 | >1 | true | false | false | <=1 | * | true | false | true | >1 | * | error | |||
<=1 | >1 | true | false | false | <=1 | * | true | true | false | <=1 | false | error | |||
<=1 | >1 | true | false | false | <=1 | * | true | true | false | <=1 | true | known | user | unknown | user |
<=1 | >1 | true | false | false | <=1 | * | true | true | false | >1 | * | error | |||
<=1 | > 1 | true | false | false | <=1 | * | true | true | true | <=1 | false | error | |||
<=1 | > 1 | true | false | false | <=1 | * | true | true | true | <=1 | true | known | user | unknown | user |
<=1 | > 1 | true | false | false | <=1 | * | true | true | true | >1 | * | error | |||
<=1 | * | true | false | false | >1 | * | * | * | * | * | * | error | |||
<=1 | * | true | false | true | <=1 | * | false | N/A | N/A | * | * | unknown | user | unknown | system |
<=1 | <=1 | true | false | true | <=1 | * | true | * | * | * | * | error | |||
<=1 | >1 | true | false | true | <=1 | * | true | false | false | <=1 | * | unknown | user | known | user |
<=1 | >1 | true | false | true | <=1 | * | true | false | false | >1 | * | error | |||
<=1 | >1 | true | false | true | <=1 | * | true | false | true | <=1 | * | unknown | user | unknown | user |
<=1 | >1 | true | false | true | <=1 | * | true | false | true | >1 | * | error | |||
<=1 | >1 | true | false | true | <=1 | * | true | true | false | <=1 | false | unknown | user | unknown | user |
<=1 | >1 | true | false | true | <=1 | * | true | true | false | <=1 | true | unknown | user | unknown | user |
<=1 | >1 | true | false | true | <=1 | * | true | true | false | >1 | * | error | |||
<=1 | >1 | true | false | true | <=1 | * | true | true | true | <=1 | false | error | |||
<=1 | >1 | true | false | true | <=1 | * | true | true | true | <=1 | true | unknown | user | unknown | user |
<=1 | >1 | true | false | true | <=1 | * | true | true | true | >1 | * | error | |||
<=1 | * | true | false | true | >1 | * | * | * | * | * | * | error | |||
<=1 | * | true | true | false | <=1 | false | * | * | * | * | * | error | |||
<=1 | * | true | true | false | <=1 | true | false | N/A | N/A | * | * | unknown | user | unknown | system |
<=1 | <=1 | true | true | false | <=1 | true | true | * | * | * | * | error | |||
<=1 | >1 | true | true | false | <=1 | true | true | false | false | <=1 | * | unknown | user | known | user |
<=1 | >1 | true | true | false | <=1 | true | true | false | false | >1 | * | error | |||
<=1 | >1 | true | true | false | <=1 | true | true | false | true | <=1 | * | unknown | user | unknown | user |
<=1 | >1 | true | true | false | <=1 | true | true | false | true | >1 | * | error | |||
<=1 | >1 | true | true | false | <=1 | true | true | true | false | <=1 | false | error | |||
<=1 | >1 | true | true | false | <=1 | true | true | true | false | <=1 | true | unknown | user | unknown | user |
<=1 | >1 | true | true | false | <=1 | true | true | true | false | >1 | * | error | |||
<=1 | >1 | true | true | false | <=1 | true | true | true | true | <=1 | false | error | |||
<=1 | >1 | true | true | false | <=1 | true | true | true | true | <=1 | true | unknown | user | unknown | user |
<=1 | >1 | true | true | false | <=1 | true | true | true | true | >1 | * | error | |||
<=1 | * | true | true | false | >1 | * | * | * | * | * | * | error | |||
<=1 | * | true | true | true | <=1 | false | * | * | * | * | * | error | |||
<=1 | * | true | true | true | <=1 | true | false | N/A | N/A | * | * | unknown | user | unknown | system |
<=1 | <=1 | true | true | true | <=1 | true | true | * | * | * | * | error | |||
<=1 | >1 | true | true | true | <=1 | true | true | false | false | <=1 | * | unknown | user | known | user |
<=1 | >1 | true | true | true | <=1 | true | true | false | false | >1 | * | error | |||
<=1 | >1 | true | true | true | <=1 | true | true | false | true | <=1 | * | unknown | user | unknown | user |
<=1 | >1 | true | true | true | <=1 | true | true | false | true | >1 | * | error | |||
<=1 | >1 | true | true | true | <=1 | true | true | true | false | <=1 | false | error | |||
<=1 | >1 | true | true | true | <=1 | true | true | true | false | <=1 | true | unknown | user | unknown | user |
<=1 | >1 | true | true | true | <=1 | true | true | true | false | >1 | * | error | |||
<=1 | >1 | true | true | true | <=1 | true | true | true | true | <=1 | false | error | |||
<=1 | >1 | true | true | true | <=1 | true | true | true | true | <=1 | true | unknown | user | unknown | user |
<=1 | >1 | true | true | true | <=1 | true | true | true | true | >1 | * | error | |||
<=1 | * | true | true | true | >1 | * | * | * | * | * | * | error | |||
>1 | * | false | * | * | * | * | false | * | * | * | * | error | |||
>1 | * | false | true | error | |||||||||||
>1 | * | true | false | error | |||||||||||
>1 | * | true | true | see note |
Note:
- when choice minOccurs = n > 1, at least n-m elements must be present in the XML, where m = the number of elements with minOccurs = 0 and which are not present in the XML, otherwise an error is thrown
2.2.2 Multi-Valued Attributes
For multi-valued attributes inside choices the same rules apply as for single-valued attributes (chapter 2.2.1). In addition, there can be situations where the number of values (elements) does not match the maxOccurs on the element inside the choice. In this case an error is thrown.
2.2.3 Single-Valued Relations
For single-valued relations the same rules apply as for single-valued attributes (chapter 2.2.1) with one difference: if an element is present (with sub-content, empty or nil) a corresponding instance is created and the relation is set. So all of the following tags result in a known, user-set value in a relation:
- <A>...</A>
- <A/>
- <A xsi:nil="true"/>
When a tag is empty and not nil, the rules on this page apply recursively for the sub-elements that are expected conform the XSD.
When a tag is nil, an instance is created and all requirements for sub-elements are skipped. The relation is set to an instance with all its attributes and relations system-set unknown.
2.2.4 Multi-Valued Relations
For multi-valued relations the same rules apply as for single-valued relations (chapter 2.2.3). In addition, there can be situations where the number of values (elements) does not match the maxOccurs on the element inside the choice. In this case an error is thrown.
When a multi-valued relation is mapped directly to a choice, at least as many choices must be possible indicated by the minOccurs and maxOccurs on the choice. If there are too few or too many elements, an error is thrown.