title: What is the syntax to define the maxLength facet in XML Schema?
body: <p>I'm trying to validate an XML schema with several tools, but I'm not getting a consistent message, depending on which tool I use. The following syntax seems to be the issue:</p>
  
  <pre><code>&lt;xs:element name="Name" 
              minOccurs="1" 
              type ="xs:string" 
              maxLength = "125"/&gt;
  </code></pre>
  
  <p>XML-Spy triggers an error whereas Notepad ++ (windows) and XML Copy Editor (Ubuntu) validate it.  So is that syntax correct, or should I use this:</p>
  
  <pre><code>&lt;xs:element name="name"&gt;
    &lt;xs:simpleType&gt;
      &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:minOccurs="1"/&gt;
        &lt;xs:maxLength = "125"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
  &lt;/xs:element&gt;
  </code></pre>