sissaschool / xmlschema

XML Schema validator and data conversion library for Python
MIT License
416 stars 72 forks source link

xmlschema.exceptions.XMLSchemaParseError: base XsdComplexType is simple or has a simple content #20

Closed Thomasb81 closed 7 years ago

Thomasb81 commented 7 years ago

Hello

With following schema http://www.eda.org/xmlschema/ipxact/1685-2014

I got the following exception error:

    raise error
xmlschema.exceptions.XMLSchemaParseError: base <XsdComplexType u'{http://www.accellera.org/XMLSchema/IPXACT/1685-2014}unsignedBitExpression' at 0x7fc8a29e4f90> is simple or has a simple content.

  <xs:extension xmlns:xs="http://www.w3.org/2001/XMLSchema" base="ipxact:unsignedBitExpression">
                <xs:attribute name="resetTypeRef" type="xs:Name">
                    <xs:annotation>
                        <xs:documentation>Reference to a user defined resetType. Assumed to be HARD if not present.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attributeGroup ref="ipxact:id.att" />
  </xs:extension>

It look like the tool rise an error because it check the schema again xmlschema 1.1 (2012) while the document is suppose to be conform to xmlschema 1.0 (2001)

I use the following code:

import xmlschema
my_schema = xmlschema.XMLSchema('1685-2014/component.xsd')

here is an archive of the schema: 1685-2014.zip Thomas

brunato commented 7 years ago

The version 0.9.13 seems fix this error.

In a comment of the code I refer to the related section of XSD 1.1 standard only because is more clear than XSD 1.0 docs. There are no differences between XSD 1.0 and XSD 1.1 for this rule.

Verify if the schema works now. I close this issue, reopen if the error persists.