title: XML Validation: "No Child Element Is Expected At This Point"
body: <p>I'm trying to develop an XSD grammar according to a given XML file. The given XML file <em>itemList.xml</em> is shown as below.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding = "utf-8"?&gt;
  &lt;itemList 
      xmlns="http://www.w3schools.com" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xsi:schemaLocation="http://www.w3schools.com  itemList.xsd" &gt;
       &lt;item&gt;spoon&lt;/item&gt;  
       &lt;item&gt;knife&lt;/item&gt;
       &lt;item&gt;fork&lt;/item&gt;  
       &lt;item&gt;cup&lt;/item&gt;
  &lt;/itemList&gt;
  </code></pre>
  
  <p>The <em>itemList.xsd</em> file that I developed is shown as below.</p>
  
  <pre><code>&lt;schema 
      xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:co="http://www.w3schools.com"
      targetNamespace="http://www.w3schools.com" 
      elementFormDefault="qualified"&gt;
      &lt;simpleType name="itemType"&gt;
          &lt;restriction base="string"/&gt;
      &lt;/simpleType&gt;
      &lt;complexType name="itemListType"&gt;
          &lt;sequence&gt;
              &lt;element name="item" type="co:itemType"/&gt;
          &lt;/sequence&gt;
      &lt;/complexType&gt;
      &lt;element name="itemList" type="co:itemListType"/&gt;
  &lt;/schema&gt;
  </code></pre>
  
  <p>When I validate the XML against the XSD using <a href="http://www.freeformatter.com/xml-validator-xsd.html" rel="noreferrer">this XML validator</a>, I get the error </p>
  
  <pre><code>Cvc-complex-type.2.4.d: Invalid Content Was Found Starting With Element 'item'. No Child Element Is Expected At This Point.. Line '6', Column '12'.
  </code></pre>
  
  <p>It seems that I should rewrite my <code>complexType</code> in <em>itemList.xsd</em>, but I'm not sure what to do. Many thanks to whoever could help.</p>