Note that there are some explanatory texts on larger screens.

plurals
  1. POXML Validation issue: error s4s-elt-must-match
    primarykey
    data
    text
    <p>I'm currently playing around with some basic XS Schema stuff, but am getting an irritating error when attempting to validate my schema. I'm using XMLValidation.com and the error I'm getting is:</p> <pre><code>s4s-elt-must-match.1: The content of 'lecturers' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: element. </code></pre> <p>Then, my XSD is as follows:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:element name="lecturers"&gt; &lt;xs:element name="lecturer"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="name" type="xs:string" /&gt; &lt;xs:attribute name="title" type="xs:string" /&gt; &lt;xs:attribute name="first" type="xs:string" /&gt; &lt;xs:attribute name="last" type="xs:string" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;xs:element name="teaching"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="course" type="xs:string" /&gt; &lt;xs:attribute name="code" type="xs:string" /&gt; &lt;xs:element name="course" type="xs:string" /&gt; &lt;xs:attribute name="code" type="xs:string" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="research" type="xs:string"/&gt; &lt;/xs:element&gt; &lt;/xs:element&gt; &lt;/xs:schema&gt; </code></pre> <p>The corresponding XML file reads like:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;lecturers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="lecturers.xsd"&gt; &lt;lecturer&gt; &lt;name title="Professor" first="Peter" last="Quirk" /&gt; &lt;teaching&gt; &lt;course code="CO3070"&gt;XML and the Web&lt;/course&gt; &lt;course code="CO3300"&gt;Web Server Architectures&lt;/course&gt; &lt;/teaching&gt; &lt;research&gt;The application of Web protocols to Biology&lt;/research&gt; &lt;/lecturer&gt; &lt;/lecturers&gt; </code></pre> <p>Anyone have any ideas why my code isn't validating and what I can do to sort it out. Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload