The element type xs:element must be terminated by the matching end-tag </xs:element>
<p>I have an error message on my XML Schema.  To start, here is my XML file: </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;customer xmlns:xsi="http:www.w3.org/2001/XMLSchema"
    xsi:noNamespaceSchemaLocation="customer.xsd"&gt;
    &lt;name&gt;
        &lt;first&gt;Bob&lt;/first&gt;
        &lt;MI&gt;H&lt;/MI&gt;
        &lt;last&gt;Jones&lt;/last&gt;
    &lt;/name&gt;
    &lt;cnum&gt;007389&lt;/cnum&gt;
    &lt;mail_a&gt;
        &lt;line1&gt;12345 Mockingbird Lane&lt;/line1&gt;
        &lt;city&gt;Omaha&lt;/city&gt;
        &lt;state&gt;NE&lt;/state&gt;
        &lt;zip&gt;68123&lt;/zip&gt;
        &lt;country&gt;USA&lt;/country&gt;
    &lt;/mail_a&gt;
    &lt;deliver_a&gt;
        &lt;line1&gt;12345 Mockingbird Lane&lt;/line1&gt;
        &lt;city&gt;Omaha&lt;/city&gt;
        &lt;state&gt;NE&lt;/state&gt;
        &lt;zip&gt;68123&lt;/zip&gt;
        &lt;country&gt;USA&lt;/country&gt;
    &lt;/deliver_a&gt;
    &lt;member_date&gt;1995-10-15&lt;/member_date&gt;
    &lt;l_order_date&gt;2003-08-02&lt;/l_order_date&gt;
&lt;/customer&gt;
</code></pre>

<p>And here is my schema: </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="customer"/&gt;
  &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element ref="name"/&gt;
      &lt;xs:element ref="cnum"/&gt;
      &lt;xs:element ref="mail_a"/&gt;
      &lt;xs:element ref="deliver_a"/&gt;
      &lt;xs:element ref="member_date"/&gt;
      &lt;xs:element ref="l_order_date"/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;xs:element name="first" type="xs:string"/&gt;
&lt;xs:element name="MI" type="xs:string"/&gt;
&lt;xs:element name="last" type="xs:string"/&gt;
&lt;xs:element name="cnum" type="xs:integer"/&gt;
&lt;xs:element name="line1" type="xs:string"/&gt;
&lt;xs:element name="city" type="xs:string"/&gt;
&lt;xs:element name="state" type="xs:string"/&gt;
&lt;xs:element name="zip" type="xs:integer"/&gt;
&lt;xs:element name="country" type="xs:string"/&gt;
&lt;xs:element name="member_date" type="xs:date"/&gt;
&lt;xs:element name="l_order_date" type="xs:date"/&gt;

&lt;xs:element name="name"&gt;
  &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element ref="first"/&gt;
      &lt;xs:element ref="MI"/&gt;
      &lt;xs:element ref="last"/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

 &lt;xs:element name="mail_a"&gt;
  &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element ref="line1"/&gt;
      &lt;xs:element ref="city"/&gt;
      &lt;xs:element ref="state"/&gt;
      &lt;xs:element ref="zip"/&gt;
        &lt;xs:element ref="country"/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;


&lt;xs:element name="deliver_a"&gt;
  &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element ref="line1"/&gt;
      &lt;xs:element ref="city"/&gt;
      &lt;xs:element ref="state"/&gt;
      &lt;xs:element ref="zip"/&gt;
      &lt;xs:element ref="country"/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;
&lt;/xs:schema&gt;
</code></pre>

<p>The error that I'm getting is</p>

<blockquote>
  <p>The element type <code>xs:element</code> must be terminated by the matching
  end-tag <code>&lt;/xs:element&gt;</code></p>
</blockquote>

<p>It appears that it doesn't like line 55 for some reason (element ref="line1"), which has a closing tag on it. </p>

<p>The XML file says that I'm missing the xs:schema end tag.  Well, there it is...
The editor that I'm using is oXygen. </p>

<p>Any thoughts? I've been fiddling around with it forever.</p>