After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619640 - XML schema compilation failure with restrict/union
XML schema compilation failure with restrict/union
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-25 17:15 UTC by Lukas Kuklinek
Modified: 2012-01-05 03:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lukas Kuklinek 2010-05-25 17:15:36 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
Comment 1 Lukas Kuklinek 2010-05-25 17:54:36 UTC
Original maillist entry: http://mail.gnome.org/archives/xml/2010-April/msg00011.html
Comment 2 Daniel Veillard 2012-01-05 03:04:46 UTC
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