title: Understanding elementFormDefault qualified/unqualified when validating xml against a WSDL (xsd schema)
body: <p>I'm trying to understand the implications of <code>elementFormDefault="qualified/unqualified"</code> in an XML schema which is embedded in WSDL (SOAP 1.1, WSDL 1).</p>
  
  <p>For example I have this schema inside a WSDL:</p>
  
  <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"
      targetNamespace="http://www.example.com/library"&gt;
      &lt;xsd:element name="person"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element name="name" type="xsd:string"/&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p>In plain XML this is obviously invalid because "name" has no specified namespace:</p>
  
  <pre><code>&lt;lib:person xmlns:lib="http://www.example.com/library"&gt;
      &lt;name&gt;XML Schema&lt;/name&gt;
  &lt;/lib:person&gt;
  </code></pre>
  
  <p>while this is obviously valid because all elements are qualified:</p>
  
  <pre><code>&lt;lib:person xmlns:lib="http://www.example.com/library"&gt;
      &lt;lib:name&gt;qualified xml&lt;/lib:name&gt;
  &lt;/lib:person&gt;
  </code></pre>
  
  <p>But surprisingly libxml says that the following is also valid:</p>
  
  <pre><code>&lt;person xmlns="http://www.example.com/library"&gt;
      &lt;name&gt;XML Schema&lt;/name&gt;
  &lt;/person&gt;
  </code></pre>
  
  <p><strong>Question 1</strong>: I assumed that <code>qualified</code> meant <code>&lt;person&gt;</code> should look something like <code>&lt;lib:person xmlns:lib="..."&gt;</code>. But the results seem to indicate that the <code>xmlns</code> attribute does the same?</p>
  
  <p>Now assume that the above XML is part of a SOAP request, e.g.</p>
  
  <pre><code>...
  &lt;s:Body&gt;
      &lt;person xmlns="http://www.example.com/library"&gt;
          &lt;name&gt;XML Schema&lt;/name&gt;
      &lt;/person&gt;
  &lt;/s:Body&gt;
  ...
  </code></pre>
  
  <p><strong>Question 2</strong>: Is the request above valid if the WSDL contains a <code>qualified</code> schema as displayed above? (plain SOAP, disregarding WS-I basic profile)</p>
  
  <p><strong>Question 3</strong> When I consider WS-I Basic profile (especially <a href="http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16462544" rel="noreferrer">4.1.13 SOAP Body and Namespaces</a>) is the above request still valid? (is <code>person</code> considered "namespace qualified"?)</p>