title: Is xml:lang allowed on element declared in schema as xs:string?
body: <p><br>
  Given the following schema</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             targetNamespace="http://tempuri.org/foo"
             elementFormDefault="qualified"&gt;
    &lt;xs:element name="foo" type="xs:string" /&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>Is the following XML valid?</p>
  
  <pre><code>&lt;foo xmlns="http://tempuri.org/foo" xml:lang="en-US"&gt;test&lt;/foo&gt;
  </code></pre>
  
  <p>That is, is the "xml:lang" attribute allowed here?</p>
  
  <p>The reason for this question is that WCF (Windows Communication Foundation) endpoints configured to use SOAP/1.1 over HTTP (basicHttpBinding in WCF terms) always includes the "xml:lang" attribute on the "faultstring" element when a fault is raised. According to the SOAP/1.1 envelope schema this element is of the simple type "xs:string".  </p>
  
  <p>I wouldn't really care if it wasn't for a customer ours is having problems deserializing these faults. I have reported this as a <a href="https://connect.microsoft.com/wcf/feedback/details/619941/endpoint-with-basichttpbinding-produces-invalid-soap-1-1-faults" rel="nofollow">potential bug</a> to Microsoft but got the response that this is by design and that it is conformant to SOAP/1.1. Reading XML Schema specifications leads me to believe that Microsoft is wrong and that no attributes are allowed on elements of simple types. </p>
  
  <p>Am I missing something here related to attributes in the "xml:" namespace?</p>
  
  <p>What I really would like to have is some sort of "official" definition that allows me to say "you're wrong" to Microsoft or "you have a buggy WS stack" to our customer without making a fool of myself.</p>
  
  <p><strong>EDIT</strong>: The answer to the title question seems to be "no" as stated below. The resolution to my WCF problem turned out to be pretty simple as well. Pass the empty string as the xmlLang parameter in the constructor of the System.ServiceModel.FaultReasonText and the attribute won't be added. Passing null doesn't work (ArgumentNullException) and neither does the one argument constructor (the system default language will be set as xml:lang)</p>