2

I am writing a library that produces xml messages based on an XML message format defined in an XSD. I however have a couple of questions in regard to the following schema:

Is the element SOPClass required in the ParticipantObjectIdentificationContents object?

<xs:complexType name="ParticipantObjectIdentificationContents">
    <xs:sequence>
        <!-- there are other elements here -->
        <xs:group ref="DICOMObjectDescriptionContents"/>
        <!-- there are other elements here -->
    </xs:sequence>
</xs:complexType>
<xs:group name="DICOMObjectDescriptionContents">
    <xs:sequence>
        <!-- there are other elements here -->
        <xs:element ref="SOPClass"/>
        <!-- there are other elements here -->
    </xs:sequence>
</xs:group>
<xs:element name="SOPClass">
    <xs:complexType>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" ref="Instance"/>
        </xs:sequence>
        <xs:attribute name="UID" type="xs:token"/>
        <xs:attribute name="NumberOfInstances" use="required" type="xs:integer"/>
    </xs:complexType>
</xs:element>
<xs:element name="Instance">
    <xs:complexType>
        <xs:attribute name="UID" use="required" type="xs:token"/>
    </xs:complexType>
</xs:element>
bleepzter
  • 9,607
  • 11
  • 41
  • 64

1 Answers1

6

Yes. The default value for minOccurs and maxOccurs is 1, so SOPClass must occur once and only once. See XML Schema minOccurs / maxOccurs default values

Community
  • 1
  • 1
skaffman
  • 398,947
  • 96
  • 818
  • 769