2012-01-05 50 views
2

我在寫一個基於XSD中定義的XML消息格式生成XML消息的庫。然而,我對於以下模式有幾個問題:如果未指定其多重性,是否需要該元素?

ParticipantObjectIdentificationContents對象中是否需要元素SOPClass

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

回答

相關問題