s4s-elt-must-match.1:X 的内容必须匹配 (annotation?, (simpleType | c


<?xml version="1.0" encoding="utf-8"  ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="City">
<xsd:complextype>
<xsd:sequence>
<!--BUILDING ELEMENT //1 - Skyscraper-->
<xsd:element name="Skyscraper">
<!--A city can have a total of 50 skyscrapers-->
<xsd:complextype>
<xsd:sequence>
<!--SKYSCRAPER ATTRIBUTE //1 - Material-->
<xsd:attribute name="PrimaryMaterial" use="required">
<xsd:simpletype>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="concrete"/>
<xsd:enumeration value="steel"/>
<xsd:enumeration value="aluminium"/>
<xsd:enumeration value="glass"/>
<xsd:enumeration value="wood"/>
</xsd:restriction>
</xsd:simpletype>
</xsd:attribute>
<!--SKYSCRAPER ELEMENT //1 - Height-->
<xsd:element name="Height" type="xsd:integer"/>
<!--SKYSCRAPER ELEMENT //2 - ConstructionStarted-->
<xsd:element name="ConstructionStarted" type="xsd:integer"/>
<!--SKYSCRAPER ELEMENT //3 ConstructionStopped-->
<xsd:element name="ConstructionStopped" type="xsd:integer"/>
</xsd:sequence>
</xsd:complextype>
</xsd:element>
</xsd:sequence>
</xsd:complextype>
</xsd:element>
</xsd:schema>

错误 s4s-elt-must-match.1:"City"的内容必须匹配 (annotation?, (simpleType | complexType(?, (unique | key | keyref(*((。 从 开始发现一个问题:复杂类型。

XML 和 XSD 区分大小写,因此您必须(至少(对 XSD 进行以下更正:

  • xsd:complextypexsd:complexType
  • xsd:simpletypexsd:simpleType

相关内容

  • 没有找到相关文章

最新更新