title: XML Schema how to write string with childless element
body: <p>I have an XML file. I am trying to generate xsd schema file. My xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="sample.xsd" id="62378"&gt;
  
    &lt;title&gt;Beans On Toast&lt;/title&gt;
    &lt;ingredients&gt;
       &lt;item quantity="1" unit="slice"&gt;bread&lt;/item&gt;
       &lt;item quantity="1" unit="can"&gt;bakedbeans&lt;/item&gt;        
    &lt;/ingredients&gt; 
  &lt;/recipe&gt;
  </code></pre>
  
  <p>My schema file is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
  &lt;xs:element name="recipe" type="recipeType"/&gt;
  &lt;xs:complexType name="recipeType"&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="title" type="xs:string"/&gt;
          &lt;xs:element name="ingredients" type="ingredientsType"/&gt;           
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="id" type="xs:integer"/&gt;
  &lt;/xs:complexType&gt;
  
  &lt;xs:complexType name="ingredientsType"&gt;
      &lt;xs:sequence&gt;
          &lt;xs:element name="item" type="itemType"/&gt;
      &lt;/xs:sequence&gt;    
  &lt;/xs:complexType&gt;          
  
  &lt;xs:complexType name="itemType"&gt;
      &lt;xs:attribute name="quantity" type="xs:integer"/&gt;
      &lt;xs:attribute name="unit" type="xs:string"/&gt;
  &lt;/xs:complexType&gt;    
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>I am getting error while validating. I know the reason. Because I have failed to define element item type = xs:string because I have to write complexType("itemType") for attributes. Can anyone please solve this issue?</p>