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。