Rules for defining attributes as sub-elements

Build 1501 on 14/Nov/2017  This topic last edited on: 25/Aug/2014, at 10:33

Certain restrictions apply to defining attributes as sub-elements:

1.The ‘choice’ particle cannot be used – only ‘sequence’ or ‘group’

2.A sequence can contain only elements or groups (i.e., no ‘any’, ‘choice’ or other ‘sequence)’.

3.The elements must have a maxOccurs value of 1 (that is the default).

4.The element must have a minOccurs of either 0 – that means that the corresponding object attribute is optional or 1 –indicating that the corresponding object attribute is compulsory.

5.The element can be declared nillable (‘nillable=”true”’). In such a case, the corresponding object attribute is always optional, regardless of the value of minOccurs.

NOTE

If groups are used they must follow the same rules: do not use the ‘choice’ particle and contain a sequence of elements and/or other groups.