GNOME Bugzilla – Bug 307508
Not determinist content for xs:schema declaration
Last modified: 2009-08-15 18:40:50 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.
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
This should be closed by release of libxml2-2.6.21, thanks, Daniel