title: RelaxNG validation using xmllint
body: <p>I'm trying to make xmllint to validate this schema. Unfortunately I came to some strange issue. It looks like xmllint interpretes wrong <strong>optional</strong> arguments without <strong>interleave</strong> tag included. Here is some test schema with misspelled tag <em>person</em> which should be signalized by xmllint. Unfortunately xmllint is raporting some other non-existing bug. Please take a look maybe I'm doing something wrong:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;grammar xmlns="http://relaxng.org/ns/structure/1.0"&gt;
  
  &lt;define name="testproject"&gt;
      &lt;element name="testproject"&gt;
          &lt;ref name="overview"/&gt;
          &lt;ref name="tests"/&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="overview"&gt;
      &lt;element name="overview"&gt;
          &lt;ref name="title"/&gt;
          &lt;oneOrMore&gt;
              &lt;ref name="person"/&gt;
          &lt;/oneOrMore&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="tests"&gt;
      &lt;element name="tests"&gt;
  
          &lt;choice&gt;
              &lt;attribute name="file"/&gt;
  
              &lt;group&gt;
                  &lt;ref name="title"/&gt;
                  &lt;optional&gt;
                      &lt;ref name="field"/&gt;
                  &lt;/optional&gt;
                  &lt;optional&gt;
                      &lt;ref name="field2"/&gt;
                  &lt;/optional&gt;
                  &lt;optional&gt;
                      &lt;ref name="field3"/&gt;
                  &lt;/optional&gt;
  
                  &lt;choice&gt;
                      &lt;zeroOrMore&gt;
                          &lt;ref name="test"/&gt;
                      &lt;/zeroOrMore&gt;
                      &lt;zeroOrMore&gt;
                          &lt;ref name="tests"/&gt;
                      &lt;/zeroOrMore&gt;
                  &lt;/choice&gt;
              &lt;/group&gt;
          &lt;/choice&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="test"&gt;
      &lt;element name="test"&gt;
          &lt;attribute name="name"/&gt;
  
          &lt;interleave&gt;
              &lt;optional&gt;
                  &lt;ref name="title"/&gt;
              &lt;/optional&gt;
              &lt;ref name="field"/&gt;
              &lt;zeroOrMore&gt;
                  &lt;ref name="person"/&gt;
              &lt;/zeroOrMore&gt;
          &lt;/interleave&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="title"&gt;
      &lt;element name="title"&gt;
          &lt;text/&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="field"&gt;
      &lt;element name="field"&gt;
          &lt;text/&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="field2"&gt;
      &lt;element name="field2"&gt;
          &lt;text/&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="field3"&gt;
      &lt;element name="field3"&gt;
          &lt;text/&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;define name="person"&gt;
      &lt;element name="person"&gt;
          &lt;text/&gt;
      &lt;/element&gt;
  &lt;/define&gt;
  
  &lt;start&gt;
      &lt;ref name="testproject"/&gt;
  &lt;/start&gt;
  &lt;/grammar&gt;
  </code></pre>
  
  <p>And xml file content:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  
  &lt;testproject&gt;
  &lt;overview&gt;
      &lt;title&gt;
          some title
      &lt;/title&gt;
      &lt;person&gt;J33nn&lt;/person&gt;
  &lt;/overview&gt;
  
  &lt;tests&gt;
      &lt;title&gt;
          Some title test
      &lt;/title&gt;
      &lt;field&gt;as&lt;/field&gt; 
      &lt;test name="TestName"&gt;
          &lt;title&gt;Some title&lt;/title&gt;
  
          &lt;field&gt;
              dasdasd
          &lt;/field&gt;
  
          &lt;peron&gt;J33nn&lt;/peron&gt;
      &lt;/test&gt;
  &lt;/tests&gt;
  &lt;/testproject&gt;
  </code></pre>
  
  <p>And instead of reporting misspelled tag <em>peron</em> it reports something like this:</p>
  
  <p><strong>element field: Relax-NG validity error : Element tests has extra content: field</strong></p>