rust-xml-schema icon indicating copy to clipboard operation
rust-xml-schema copied to clipboard

Failed to parse "mixed" attribute in complexType

Open marcelbuesing opened this issue 6 years ago • 1 comments

I run in the following error when adding mixed="false" in the test_parser.rs.

const PERSON_XSD: &'static str = r#"
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="foo">
   <xs:element name="person">
     <xs:complexType abstract="false" mixed="false">
       <xs:sequence>
         <xs:element name="name" type="xs:string" />
         <xs:element name="firstname" type="xs:string" />
         <xs:element name="birthdate" type="xs:date" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>
 </xs:schema>"#;
thread 'test_parser::generated_parses_person_xsd' panicked at 'Could not parse mixed="false", name=StrSpan("complexType" 122..133 -  
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="foo">
    <xs:element name="person">
      <xs:complexType mixed="false">
        <xs:sequence>
          <xs:element name="name" type="xs:string" />
          <xs:element name="firstname" type="xs:string" />
          <xs:element name="birthdate" type="xs:date" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:schema>)', xml-schema/src/parser.rs:2606:5

marcelbuesing avatar Aug 14 '19 19:08 marcelbuesing

I realized a few weeks ago that this crate has a major issue of type confusion, this might be the root cause. I'm in the middle of a large refactoring to fix that issue, which may solve this one as well; but it will take time.

progval avatar Aug 14 '19 21:08 progval