progval / rust-xml-schema

[WIP] (Self-generating) XML parser generator based on XML schemas.
GNU Affero General Public License v3.0
28 stars 3 forks source link

Failed to parse "mixed" attribute in complexType #2

Open marcelbuesing opened 5 years ago

marcelbuesing commented 5 years ago

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
progval commented 5 years ago

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.