1
如何確保在location
元素包含在XML中時至少指定了location
的子元素(locality
,wkt
)中的一個?如何確保至少有一個子元素通過XSD存在?
<xs:element name="location" nillable="true" minOccurs="0">
<xs:complexType>
<xs:group ref="cs:locationGroup"></xs:group>
</xs:complexType>
</xs:element>
的locationGroup
定義:
<xs:group name="locationGroup">
<xs:all>
<xs:element name="locality" minOccurs="0"/>
<xs:element name="wkt" minOccurs="0"/>
</xs:all>
</xs:group>
我的XSD的版本是1.0。