据我所见,以下 XML 应该通过针对其下方的 XSD 的验证,因为所有“symbolName”值都是唯一的。但是,当我尝试验证它时,我收到以下错误
身份约束“xxxxxxsdfsdfsdfsdf”的字段“symbolName”在元素“symbols”范围内匹配 9 次
<levelSymbolCollection>
<levelName>Simple</levelName>
<symbols>
<symbolName>Letter-A</symbolName>
<symbolName>Letter-B</symbolName>
<symbolName>Letter-C</symbolName>
<symbolName>Letter-D</symbolName>
<symbolName>Letter-E</symbolName>
<symbolName>Letter-F</symbolName>
<symbolName>Letter-I</symbolName>
<symbolName>Letter-O</symbolName>
<symbolName>Letter-U</symbolName>
</symbols>
</levelSymbolCollection>
<xs:element name="levelSymbolCollection" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="levelName" type="requiredString"/>
<xs:element name="symbols">
<xs:complexType>
<xs:sequence>
<xs:element name="symbolName" type="requiredString" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="xxxxxxxxsdfsdfsdfsdf">
<xs:selector xpath="symbols"></xs:selector>
<xs:field xpath="symbolName"></xs:field>
</xs:unique>
</xs:element>