When using XML Schema to declare that a complexType
has just one child element, all the below three approaches achieve the goal:
<xs:complexType> <xs:sequence> <xs:element ref="somevalue"/> </xs:sequence> </xs:comlexType>
<xs:complexType> <xs:choice> <xs:element ref="somevalue"/> </xs:choice> </xs:comlexType>
<xs:complexType> <xs:all> <xs:element ref="somevalue"/> </xs:all> </xs:comlexType>
Apparently, the sequence
, choice
and all
are not necessary to for a single element, because they should by used to indicate the order of multiple elements. Is there a more concise way to declare a complexType
that has only one child element? (I.e. one that eliminates the use of sequence
, all
or choice
, somehow.)