GNOME Bugzilla – Bug 619640
XML schema compilation failure with restrict/union
Last modified: 2012-01-05 03:04:46 UTC
The xmllint tool (or equivalent library call) refuses a valid XML schema. (or it seems to be a valid schema at least, some other validators process it just fine, availible at [1], it is a part of several interlinked schemas from [2].) It complains about wrong base type for a type with union: $ xmllint -schema oval-definitions-schema.xsd scap-rhel5-oval.xml >/dev/null oval-definitions-schema.xsd:798: element complexType: Schemas parser error : local union type: A type, derived by list or union, must have the simple ur- type definition as base type, not '{http://oval.mitre.org/XMLSchema/oval- definitions-5}(NULL)'. oval-definitions-schema.xsd:810: element complexType: Schemas parser error : local union type: A type, derived by list or union, must have the simple ur- type definition as base type, not '{http://oval.mitre.org/XMLSchema/oval- definitions-5}(NULL)'. (... and so on ...) WXS schema oval-definitions-schema.xsd failed to compile Relevant XML schema snippet: <xsd:complexType name="EntityStateBaseType" abstract="true"> <xsd:simpleContent> <xsd:extension base="oval-def:EntityBaseType"> <xsd:attribute name="entity_check" type="oval:CheckEnumeration" use="optional" default="all"/> <xsd:attribute name="var_check" type="oval:CheckEnumeration" use="optional" default="all"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> (...) <xsd:complexType name="EntityObjectBoolType"> <xsd:simpleContent> <xsd:restriction base="oval-def:EntityObjectBaseType"> <xsd:simpleType> <xsd:union memberTypes="xsd:boolean oval:EmptyStringType"/> </xsd:simpleType> </xsd:restriction> </xsd:simpleContent> </xsd:complexType> References / further information: [1]: http://oval.mitre.org/language/version5.3/ [2]: http://oval.mitre.org/language/version5.3/ovaldefinition/complete/oval-definitions-schema-complete.zip [3]: http://mail.gnome.org/archives/xml/2010-March/msg00029.html [4]: http://mail.gnome.org/archives/xml/2007-June/msg00107.html [5]: http://markmail.org/message/anzfqww27wr3jlye
Original maillist entry: http://mail.gnome.org/archives/xml/2010-April/msg00011.html
This seems fixed in libxml2 git head, possibly as a result of commit http://git.gnome.org/browse/libxml2/commit/?id=8bb12988c4ddcaf30729c04c35bf3f4afab5370a This will be in the next release, hopefully soon, Daniel