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 307508 - Not determinist content for xs:schema declaration
Not determinist content for xs:schema declaration
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-13 14:04 UTC by kbuchcik
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kbuchcik 2005-06-13 14:04:35 UTC
The xs:schema element declaration's content is incorrectly identified as "not
determinist" (from "http://www.w3.org/2001/XMLSchema.xsd").

Here the original schema part:

<xs:element name="schema" id="schema">
  <xs:annotation>
    <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
  </xs:annotation>
  <xs:complexType>
   <xs:complexContent>
    <xs:extension base="xs:openAttrs">
     <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element ref="xs:include"/>
       <xs:element ref="xs:import"/>
       <xs:element ref="xs:redefine"/>
       <xs:element ref="xs:annotation"/>
      </xs:choice>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
       <xs:group ref="xs:schemaTop"/>
       <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
     </xs:sequence>
     <xs:attribute name="targetNamespace" type="xs:anyURI"/>
     <xs:attribute name="version" type="xs:token"/>
     <xs:attribute name="finalDefault" type="xs:fullDerivationSet"
use="optional" default=""/>
     <xs:attribute name="blockDefault" type="xs:blockSet" use="optional"
default=""/>
     <xs:attribute name="attributeFormDefault" type="xs:formChoice"
use="optional" default="unqualified"/>
     <xs:attribute name="elementFormDefault" type="xs:formChoice" use="optional"
default="unqualified"/>
     <xs:attribute name="id" type="xs:ID"/>
     <xs:attribute ref="xml:lang"/>
    </xs:extension>
   </xs:complexContent>
  </xs:complexType>


The problem is isolated in the following schema:

notDeter.xsd
------------
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="urn:test:foo"
  xmlns:f="urn:test:foo">

  <xs:complexType name="notDeter">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="include"/>
        <xs:element name="annotation"/>
      </xs:choice>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:element name="bla"/>
        <xs:element name="annotation" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="foo"/>

</xs:schema>

dummy.xml
---------
<?xml version="1.0"?>
<foo xmlns="urn:test:foo"/> 

kbu@librax:/data/home/kbuchcik/gnomecvs/libxml2/xstc$ xmllint --noout --schema
notDeter.xsd dummy.xml
notDeter.xsd:7: element complexType: Schemas parser error : complex type
'notDeter': The content model is not determinist.
WXS schema notDeter.xsd failed to compile

The two "annotation" element declarations seem to trigger the error. If one of
them is given a different name, the processor is happy again.
Comment 1 Daniel Veillard 2005-08-08 11:23:47 UTC
Seems fixed in CVS for me, probably as a side effect of other regexp
fixes a few weeks ago. Once dummy.xml namespace is fixed it works:

paphio:~/XML -> ./xmllint --schema nodeter.xsd dummy.xml
<?xml version="1.0"?>
<foo xmlns="urn:test:foo"/>
dummy.xml validates
paphio:~/XML ->

Daniel
Comment 2 Daniel Veillard 2005-09-05 09:01:52 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel