title: xsd validation fails with cvc-elt.1: Cannot find the declaration of element
body: <p>I am validating my xml using my xsd in java:</p>
  
  <pre><code>javax.xml.validation.SchemaFactory
  .newInstance("http://www.w3.org/2001/XMLSchema")
  .newSchema(new java.io.File(schemaPath))
  .newValidator()
  .validate(new javax.xml.transform.stream.StreamSource(new java.io.FileInputStream(xmlPath)));
  </code></pre>
  
  <p>and I get the following error:</p>
  
  <pre><code>org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 18; cvc-elt.1: Deklaration des Elements "WrappedBodyText" kann nicht gefunden werden.
  </code></pre>
  
  <p>I reduced my xml to the following:</p>
  
  <pre><code>&lt;WrappedBodyText&gt;&lt;/WrappedBodyText&gt;
  </code></pre>
  
  <p>I reduced my xsd to:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;schema targetNamespace="http://compa.ny/customer/schema/Wrapper"
          xmlns="http://www.w3.org/2001/XMLSchema"
          xmlns:Wrapper="http://compa.ny/customer/schema/Wrapper"
          xmlns:WrapperType="http://compa.ny/customer/schema/WrapperType"
          xmlns:standardservice="http://compa.ny/standard/service/schema"&gt;
  
      &lt;complexType name="WrappedBodyText"&gt;
      &lt;/complexType&gt;
  &lt;/schema&gt;
  </code></pre>
  
  <p>I looked through several posts here or on other forums, but none of the errors I found seem to apply. Please help</p>