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 670865 - xmllint considers schema content model not determinist, although it is deterministic
xmllint considers schema content model not determinist, although it is determ...
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-27 09:00 UTC by Johan Corveleyn
Modified: 2012-08-24 06:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Johan Corveleyn 2012-02-27 09:00:28 UTC
As posted and confirmed on the mailinglist (http://mail.gnome.org/archives/xml/2012-February/msg00058.html), xmllint considers the following schema as not determinist, although it seems to be deterministic (XSV, Xerces and Visual Studio have no problem with it):

  <?xml version="1.0" encoding="UTF-8"?>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="rules">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="rule" minOccurs="0" maxOccurs="unbounded"/>
          <xs:sequence minOccurs="0" maxOccurs="1">
            <xs:element name="specialRule" minOccurs="1" maxOccurs="1"/>
            <xs:element name="rule" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:schema>

xmllint outputs:

  rules.xsd:4: element complexType: Schemas parser error : local complex type: The content model is not determinist.
  WXS schema rules.xsd failed to compile

The intention is to express that there can be any number of "rule"
elements, and there can be at most one "specialRule" (at any position
in between, before, or after the "rule"s). So the following xml's are
all valid:

  <?xml version="1.0" encoding="UTF-8"?>
  <rules>
    <rule/>
    <rule/>
    <specialRule/>
    <rule/>
  </rules>

  <?xml version="1.0" encoding="UTF-8"?>
  <rules>
    <specialRule/>
  </rules>

  <?xml version="1.0" encoding="UTF-8"?>
  <rules>
    <specialRule/>
    <rule/>
    <rule/>
    <rule/>
  </rules>

  <?xml version="1.0" encoding="UTF-8"?>
  <rules>
    <rule/>
    <rule/>
    <rule/>
  </rules>

But this one isn't (two specialRules):

  <?xml version="1.0" encoding="UTF-8"?>
  <rules>
    <specialRule/>
    <rule/>
    <rule/>
    <specialRule/>
    <rule/>
  </rules>
Comment 1 Daniel Veillard 2012-08-24 06:17:25 UTC
Fixed upstream, 

http://git.gnome.org/browse/libxml2/commit/?id=c70d185a2a3d09b0762560d4f93205da5d43396c

 thanks for the report !

Daniel