[xml] XML schema compilation failure with restrict/union



Greetings,

I am having a hard time processing OVAL XML schema [1], link to download whole 
bundle (there are several interlinked schemas) is here [2].

xmllint complains something 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>

I am no XML expert, but some other tools (e.g. xerces parser, jdom 
implementation) seem to process theese schemas fine... Is this a bug in libxml 
or are the other tools more "tolerant" according to the xml schemas standard?

libxml version: 2.7.6 and 2.7.7

Tahnks for reply.

Lukas Kuklinek

[1]: http://oval.mitre.org/language/version5.3/
[2]: http://oval.mitre.org/language/version5.3/ovaldefinition/complete/oval-
definitions-schema-complete.zip



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]