私は現在、いくつかの基本的なXSスキーマのもので遊んでいますが、スキーマを検証しようとするとイライラするエラーが発生します。XMLValidation.comを使用していますが、発生するエラーは次のとおりです。
s4s-elt-must-match.1: The content of 'lecturers' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: element.
次に、私のXSDは次のとおりです。
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="lecturers">
<xs:element name="lecturer">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:attribute name="title" type="xs:string" />
<xs:attribute name="first" type="xs:string" />
<xs:attribute name="last" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="teaching">
<xs:complexType>
<xs:sequence>
<xs:element name="course" type="xs:string" />
<xs:attribute name="code" type="xs:string" />
<xs:element name="course" type="xs:string" />
<xs:attribute name="code" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="research" type="xs:string"/>
</xs:element>
</xs:element>
</xs:schema>
対応するXMLファイルは次のようになります。
<?xml version="1.0"?>
<lecturers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="lecturers.xsd">
<lecturer>
<name title="Professor" first="Peter" last="Quirk" />
<teaching>
<course code="CO3070">XML and the Web</course>
<course code="CO3300">Web Server Architectures</course>
</teaching>
<research>The application of Web protocols to Biology</research>
</lecturer>
</lecturers>
私のコードが検証されない理由と、それを整理するために私ができることは誰でも知っています。前もって感謝します